mirror of
https://github.com/immich-app/immich.git
synced 2026-07-04 03:45:59 -07:00
9ee412110f
the album sync provider read cancellationProvider, which only exists in the background isolate and throws on the main one. moved the cancel signal onto the isolate call path. fixes #29125 fixes #29119
18 lines
766 B
Dart
18 lines
766 B
Dart
import 'package:hooks_riverpod/hooks_riverpod.dart';
|
|
import 'package:immich_mobile/domain/models/store.model.dart';
|
|
import 'package:immich_mobile/domain/services/sync_linked_album.service.dart';
|
|
import 'package:immich_mobile/entities/store.entity.dart';
|
|
import 'package:immich_mobile/providers/infrastructure/cancel.provider.dart';
|
|
import 'package:logging/logging.dart';
|
|
|
|
Future<void> syncLinkedAlbumsIsolated(ProviderContainer ref) {
|
|
final user = Store.tryGet(StoreKey.currentUser);
|
|
if (user == null) {
|
|
Logger("SyncLinkedAlbum").warning("No user logged in, skipping linked album sync");
|
|
return Future.value();
|
|
}
|
|
return ref
|
|
.read(syncLinkedAlbumServiceProvider)
|
|
.syncLinkedAlbums(user.id, cancellation: ref.read(cancellationProvider));
|
|
}
|