From f168cb82e4ae5bcda563e4dac703b8b80b5f7b89 Mon Sep 17 00:00:00 2001 From: Max Radermacher Date: Mon, 10 Apr 2023 17:40:41 -0700 Subject: [PATCH] Adapt StoryManager.setup() to `warmCaches` --- SignalServiceKit/src/Messages/Stories/StoryManager.swift | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/SignalServiceKit/src/Messages/Stories/StoryManager.swift b/SignalServiceKit/src/Messages/Stories/StoryManager.swift index 6f71c09365..6cfae98ce6 100644 --- a/SignalServiceKit/src/Messages/Stories/StoryManager.swift +++ b/SignalServiceKit/src/Messages/Stories/StoryManager.swift @@ -12,13 +12,14 @@ public class StoryManager: NSObject { @objc public class func setup() { - AppReadiness.runNowOrWhenAppDidBecomeReadyAsync { - cacheAreStoriesEnabled() - cacheAreViewReceiptsEnabled() + cacheAreStoriesEnabled() + cacheAreViewReceiptsEnabled() - // Create My Story thread if necessary + AppReadiness.runNowOrWhenAppDidBecomeReadyAsync { Self.databaseStorage.asyncWrite { transaction in + // Create My Story thread if necessary TSPrivateStoryThread.getOrCreateMyStory(transaction: transaction) + if CurrentAppContext().isMainApp { TSPrivateStoryThread.cleanupDeletedTimestamps(transaction: transaction) }