From 814f920d57260b7f66b95a94579cd7288bb270e2 Mon Sep 17 00:00:00 2001 From: Alexander Zinchuk Date: Tue, 15 Jun 2021 14:26:48 +0300 Subject: [PATCH] Cache: Do not remember selected folder --- src/global/cache.ts | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/global/cache.ts b/src/global/cache.ts index 588116cee..be1f863a1 100644 --- a/src/global/cache.ts +++ b/src/global/cache.ts @@ -114,7 +114,6 @@ function updateCache() { 'authNearestCountry', 'currentUserId', 'contactList', - 'chatFolders', 'topPeers', 'recentEmojis', 'emojiKeywords', @@ -128,6 +127,7 @@ function updateCache() { recentlyFoundChatIds: global.globalSearch.recentlyFoundChatIds, }, settings: reduceSettings(global), + chatFolders: reduceChatFolders(global), }; const json = JSON.stringify(reducedGlobal); @@ -222,3 +222,10 @@ function reduceSettings(global: GlobalState): GlobalState['settings'] { notifyExceptions: {}, }; } + +function reduceChatFolders(global: GlobalState): GlobalState['chatFolders'] { + return { + ...global.chatFolders, + activeChatFolder: 0, + }; +}