mirror of
https://github.com/immich-app/immich.git
synced 2026-05-18 03:10:24 +03:00
fix(mobile): cancel share download when dialog is dismissed (#25466)
* fix(mobile): cancel share download when dialog is dismissed * refactor: centralize temporary file cleanup logic * refactor: replace `CancellationToken` with `Completer<void>` for asset sharing cancellation --------- Co-authored-by: cmdpromptcritical <cmdpromptcritical@github.com>
This commit is contained in:
committed by
GitHub
parent
9d8efe2685
commit
ad9f3cfa05
@@ -405,11 +405,15 @@ class ActionNotifier extends Notifier<void> {
|
||||
}
|
||||
}
|
||||
|
||||
Future<ActionResult> shareAssets(ActionSource source, BuildContext context) async {
|
||||
Future<ActionResult> shareAssets(
|
||||
ActionSource source,
|
||||
BuildContext context, {
|
||||
Completer<void>? cancelCompleter,
|
||||
}) async {
|
||||
final ids = _getAssets(source).toList(growable: false);
|
||||
|
||||
try {
|
||||
await _service.shareAssets(ids, context);
|
||||
await _service.shareAssets(ids, context, cancelCompleter: cancelCompleter);
|
||||
return ActionResult(count: ids.length, success: true);
|
||||
} catch (error, stack) {
|
||||
_logger.severe('Failed to share assets', error, stack);
|
||||
|
||||
Reference in New Issue
Block a user