From 3e0a0b7417e1fbb021c0fa0612b86e2d22a3b99d Mon Sep 17 00:00:00 2001 From: Amoghavarsha Kudaligi Date: Mon, 11 Mar 2024 14:08:14 +0530 Subject: [PATCH] Fix condition of the settings being shown. --- .../popup/stateProviders/syncCookieStore/index.tsx | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/packages/extension/src/view/popup/stateProviders/syncCookieStore/index.tsx b/packages/extension/src/view/popup/stateProviders/syncCookieStore/index.tsx index 26189a98c..31a26baf9 100644 --- a/packages/extension/src/view/popup/stateProviders/syncCookieStore/index.tsx +++ b/packages/extension/src/view/popup/stateProviders/syncCookieStore/index.tsx @@ -241,11 +241,10 @@ export const Provider = ({ children }: PropsWithChildren) => { const sessionStoreChangeListener = useCallback( (changes: { [key: string]: chrome.storage.StorageChange }) => { - if ( - Object.keys(changes).includes('allowedNumberOfTabs') && - Object.keys(changes.allowedNumberOfTabs).includes('newValue') - ) { - setAllowedNumberOfTabs(changes?.allowedNumberOfTabs?.newValue); + if (changes?.['allowedNumberOfTabs']?.['newValue']) { + setAllowedNumberOfTabsForSettingsDisplay( + changes?.allowedNumberOfTabs?.newValue + ); setSettingsChanged(true); } @@ -253,7 +252,7 @@ export const Provider = ({ children }: PropsWithChildren) => { Object.keys(changes).includes('isUsingCDP') && Object.keys(changes.isUsingCDP).includes('newValue') ) { - setIsUsingCDP(changes?.isUsingCDP?.newValue); + setIsUsingCDPForSettingsDisplay(changes?.isUsingCDP?.newValue); setSettingsChanged(true); } },