mirror of
https://github.com/KevinMidboe/immich.git
synced 2025-12-08 20:29:05 +00:00
Switch to lazyBox
This commit is contained in:
@@ -15,7 +15,7 @@ class AlbumNotifier extends StateNotifier<List<AlbumResponseDto>> {
|
||||
getAllAlbums() async {
|
||||
|
||||
if (_albumCacheService.isValid() && state.isEmpty) {
|
||||
state = await _albumCacheService.getAsync();
|
||||
state = await _albumCacheService.get();
|
||||
}
|
||||
|
||||
List<AlbumResponseDto>? albums =
|
||||
|
||||
@@ -15,9 +15,9 @@ class AlbumCacheService extends JsonCache<List<AlbumResponseDto>> {
|
||||
}
|
||||
|
||||
@override
|
||||
List<AlbumResponseDto> get() {
|
||||
Future<List<AlbumResponseDto>> get() async {
|
||||
try {
|
||||
final mapList = readRawData() as List<dynamic>;
|
||||
final mapList = await readRawData() as List<dynamic>;
|
||||
|
||||
final responseData = mapList
|
||||
.map((e) => AlbumResponseDto.fromJson(e))
|
||||
|
||||
Reference in New Issue
Block a user