fix: init home widget on favorites fetch
This commit is contained in:
parent
7ddb80c64e
commit
150da15683
1 changed files with 8 additions and 0 deletions
|
@ -15,6 +15,7 @@ import 'package:photos/services/collections_service.dart';
|
|||
import 'package:photos/services/remote_sync_service.dart';
|
||||
import 'package:photos/ui/actions/collection/collection_sharing_actions.dart';
|
||||
import 'package:photos/utils/crypto_util.dart';
|
||||
import "package:photos/utils/home_widget_util.dart";
|
||||
|
||||
class FavoritesService {
|
||||
late Configuration _config;
|
||||
|
@ -51,6 +52,7 @@ class FavoritesService {
|
|||
}
|
||||
});
|
||||
await _warmUpCache();
|
||||
await _checkHomeWidget();
|
||||
}
|
||||
|
||||
void dispose() {
|
||||
|
@ -66,6 +68,12 @@ class FavoritesService {
|
|||
}
|
||||
}
|
||||
|
||||
Future<void> _checkHomeWidget() async {
|
||||
if (await countHomeWidgets() > 0 && hasFavorites()) {
|
||||
await initHomeWidget();
|
||||
}
|
||||
}
|
||||
|
||||
bool hasFavorites() {
|
||||
return _cachedFavUploadedIDs.isNotEmpty;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue