From 6464bf172f580d02b232e2b009fb0071d0a2220b Mon Sep 17 00:00:00 2001 From: Neeraj Gupta <254676+ua741@users.noreply.github.com> Date: Mon, 23 Sep 2024 14:30:20 +0530 Subject: [PATCH] refactor --- mobile/lib/services/magic_cache_service.dart | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/mobile/lib/services/magic_cache_service.dart b/mobile/lib/services/magic_cache_service.dart index ba96daeba5..3178e8c4ca 100644 --- a/mobile/lib/services/magic_cache_service.dart +++ b/mobile/lib/services/magic_cache_service.dart @@ -174,7 +174,7 @@ class MagicCacheService { _updateCacheIfTheTimeHasCome(); }); Bus.instance.on().listen((event) { - _pendingUpdateReason.add("File uploaded"); + queueUpdate("File uploaded"); }); } @@ -202,12 +202,12 @@ class MagicCacheService { final updatedJSONFile = await RemoteAssetsService.instance .getAssetIfUpdated(_kMagicPromptsDataUrl); if (updatedJSONFile != null) { - _pendingUpdateReason.add("Prompts data updated"); + queueUpdate("Prompts data updated"); } else if (lastMagicCacheUpdateTime < DateTime.now() .subtract(const Duration(days: 1)) .millisecondsSinceEpoch) { - _pendingUpdateReason.add("Cache is old"); + queueUpdate("Cache is old"); } }