fix: update photo selection logic to refresh gallery after adding photos, fixes issue where sometimes you couldn't remove a gallery item

Changed files
+11 -4
lib
+11 -4
lib/screens/gallery_edit_photos_sheet.dart
··· 222 222 context, 223 223 actorDid: actorDid, 224 224 galleryUri: widget.galleryUri, 225 - onSelect: (photos) { 226 - setState(() { 227 - _photos.addAll(photos); 228 - }); 225 + onSelect: (photos) async { 226 + // Wait for provider to update after adding 227 + await Future.delayed(const Duration(milliseconds: 100)); 228 + final updatedGallery = ref.read( 229 + galleryCacheProvider, 230 + )[widget.galleryUri]; 231 + if (updatedGallery != null && mounted) { 232 + setState(() { 233 + _photos = List.from(updatedGallery.items); 234 + }); 235 + } 229 236 }, 230 237 ); 231 238 },