Skip to content

Commit

Permalink
update logic.
Browse files Browse the repository at this point in the history
  • Loading branch information
amovar18 committed Jan 31, 2024
1 parent 40db681 commit e05f58c
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions packages/extension/src/view/devtools/app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ import './app.css';
import { Cookies } from './components';
import useFrameOverlay from './hooks/useFrameOverlay';
import { getCurrentTabId } from '../../utils/getCurrentTabId';
import { useSettingsStore } from './stateProviders/syncSettingsStore';

const App: React.FC = () => {
const [sidebarWidth, setSidebarWidth] = useState(200);
Expand Down Expand Up @@ -77,6 +78,10 @@ const App: React.FC = () => {
tabUrl: state.tabUrl,
}));

const { allowedNumberOfTabs } = useSettingsStore(({ state }) => ({
allowedNumberOfTabs: state.allowedNumberOfTabs,
}));

const listenToMouseChange = useCallback(() => {
if (contextInvalidatedRef.current) {
if (!chrome.runtime?.id) {
Expand Down Expand Up @@ -273,7 +278,11 @@ const App: React.FC = () => {
(async () => {
const localStorageFlag = localStorage.getItem('contextInvalidated');

if (localStorageFlag && localStorageFlag === 'true') {
if (
localStorageFlag &&
localStorageFlag === 'true' &&
allowedNumberOfTabs === 'unlimited'
) {
const tabId = await getCurrentTabId();

if (tabId) {
Expand All @@ -282,7 +291,7 @@ const App: React.FC = () => {
}
}
})();
}, []);
}, [allowedNumberOfTabs]);

useFrameOverlay(filteredCookies, handleUpdate);

Expand Down

0 comments on commit e05f58c

Please sign in to comment.