From a14735846cb0ec014430d2cf9637c5ef7d110ad4 Mon Sep 17 00:00:00 2001 From: Alex Date: Fri, 20 Dec 2024 13:52:42 -0600 Subject: [PATCH] chore(mobile): add timeout when reading video files (#14831) --- mobile/lib/services/backup.service.dart | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/mobile/lib/services/backup.service.dart b/mobile/lib/services/backup.service.dart index a0b6bf16c2..7bce1047e2 100644 --- a/mobile/lib/services/backup.service.dart +++ b/mobile/lib/services/backup.service.dart @@ -313,15 +313,12 @@ class BackupService { ); } } else { - if (asset.type == AssetType.video) { - file = await asset.local!.originFile; - } else { - file = await asset.local!.originFile + file = + await asset.local!.originFile.timeout(const Duration(seconds: 5)); + + if (asset.local!.isLivePhoto) { + livePhotoFile = await asset.local!.originFileWithSubtype .timeout(const Duration(seconds: 5)); - if (asset.local!.isLivePhoto) { - livePhotoFile = await asset.local!.originFileWithSubtype - .timeout(const Duration(seconds: 5)); - } } }