From 33cd46583e105304c16fdd3cc385f0271dc3b5e3 Mon Sep 17 00:00:00 2001 From: Prateek Sunal Date: Tue, 4 Mar 2025 13:02:16 +0530 Subject: [PATCH] fix: only update init if called from correct function --- mobile/lib/services/preview_video_store.dart | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/mobile/lib/services/preview_video_store.dart b/mobile/lib/services/preview_video_store.dart index 98637776bf..4312ad5168 100644 --- a/mobile/lib/services/preview_video_store.dart +++ b/mobile/lib/services/preview_video_store.dart @@ -46,7 +46,7 @@ class PreviewVideoStore { LinkedHashMap get previews => _items; late Set _failureFiles; - bool initSuccess = false; + bool _initSuccess = false; PreviewVideoStore._privateConstructor(); @@ -672,12 +672,12 @@ class PreviewVideoStore { } // generate stream for all files after cutoff date - Future _putFilesForPreviewCreation() async { + Future _putFilesForPreviewCreation([bool updateInit = false]) async { if (!isVideoStreamingEnabled || !await canUseHighBandwidth()) return; final cutoff = videoStreamingCutoff; if (cutoff == null) return; - initSuccess = true; + if (updateInit) _initSuccess = true; Map failureFiles = {}; try { @@ -757,9 +757,9 @@ class PreviewVideoStore { } void queueFiles() { - if (!initSuccess) { - _putFilesForPreviewCreation().catchError((_) { - initSuccess = false; + if (!_initSuccess) { + _putFilesForPreviewCreation(true).catchError((_) { + _initSuccess = false; }); } }