Smooth collections refresh and bump version to 3.1.1

This commit is contained in:
Lukas Müllner 2026-03-10 07:09:07 +01:00
parent a576cdd430
commit ebc42a5808
2 changed files with 15 additions and 6 deletions

View file

@ -44,7 +44,7 @@ class CollectionsScreenState extends State<CollectionsScreen>
void _handleSyncChanged() {
if (!mounted) return;
_load();
_load(showLoading: false);
}
@override
@ -59,7 +59,7 @@ class CollectionsScreenState extends State<CollectionsScreen>
void refreshIfStale({Duration maxAge = const Duration(seconds: 10)}) {
if (DateTime.now().difference(_lastLoadedAt) > maxAge) {
_load();
_load(showLoading: false);
}
}
@ -233,7 +233,7 @@ class CollectionsScreenState extends State<CollectionsScreen>
userRole: c.role,
),
),
).then((_) => _load()); // refresh counts when coming back
).then((_) => _load(showLoading: false)); // refresh counts when coming back
}
void _manageCollection(Collection c) {
@ -241,10 +241,14 @@ class CollectionsScreenState extends State<CollectionsScreen>
MaterialPageRoute(
builder: (_) => ManageCollectionScreen(collection: c),
),
).then((_) => _load());
).then((_) => _load(showLoading: false));
}
Future<void> _setActiveCollection(String collectionId) async {
if (collectionId == _activeCollectionId) {
return;
}
final userId = supabase.auth.currentUser?.id;
if (userId == null) {
showGlobalSnackBar('Please sign in again.', isError: true);
@ -257,9 +261,14 @@ class CollectionsScreenState extends State<CollectionsScreen>
userId: userId,
collectionId: collectionId,
);
final shouldNotifySync = collectionId != _activeCollectionId;
if (!mounted) return;
setState(() => _activeCollectionId = collectionId);
if (shouldNotifySync) {
MainCollectionSync.notifyChanged();
}
showGlobalInfo('Main collection set for scanning.');
}

View file

@ -16,7 +16,7 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev
# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
# In Windows, build-name is used as the major, minor, and patch parts
# of the product and file versions while build-number is used as the build suffix.
version: 3.0.0+1
version: 3.1.1+1
environment:
sdk: ^3.11.0