Skip to content

Commit

Permalink
removeLocalStorageState
Browse files Browse the repository at this point in the history
  • Loading branch information
Ross Bulat committed Mar 9, 2024
1 parent 4973eb2 commit 286896b
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/IntegrityChecks/Local.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export const checkLocalTabs = () => {

// Clear all tab data if active tabs are invalid.
if (!activeTabsValid) {
removeOnInvalidLocalTabs();
removeLocalStorageState();
}

// Clear activeTabId if it is not valid.
Expand Down Expand Up @@ -118,12 +118,15 @@ export const checkLocalChainFilter = () => {

// Tidy up local storage on invalid active tabs. Requires any local storage dependent on tabs config
// to be removed.
export const removeOnInvalidLocalTabs = () => {
export const removeLocalStorageState = () => {
localStorage.removeItem('activeTabs');
localStorage.removeItem('activeTabId');
localStorage.removeItem('activeTabIndex');
localStorage.removeItem('searchTerms');
localStorage.removeItem('customNodeUrls');
localStorage.removeItem('appliedTags');
localStorage.removeItem('pageSections');
localStorage.removeItem('pageRedirects');
};

// Call all local integrity checks.
Expand Down

0 comments on commit 286896b

Please sign in to comment.