Skip to content

Commit

Permalink
chore: remove unnecessary store val
Browse files Browse the repository at this point in the history
  • Loading branch information
ErikSin committed Apr 30, 2024
1 parent 649adca commit 6f3fea9
Showing 1 changed file with 6 additions and 13 deletions.
19 changes: 6 additions & 13 deletions src/frontend/hooks/useTabNavigationStore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,12 @@ import {TabName} from '../Navigation/types';

type NavigationStoreState = {
currentTab: TabName;
initialRouteName: TabName;
prevTab?: TabName;
initialRouteName: 'Map';
setCurrentTab: (tab: TabName) => void;
};

export const useTabNavigationStore = create<NavigationStoreState>(
(set, get) => ({
initialRouteName: 'Map',
currentTab: 'Map',
setCurrentTab: (tab: TabName) =>
set(() => ({
prevTab: get().currentTab,
currentTab: tab,
})),
}),
);
export const useTabNavigationStore = create<NavigationStoreState>(set => ({
initialRouteName: 'Map',
currentTab: 'Map',
setCurrentTab: (tab: TabName) => set(() => ({currentTab: tab})),
}));

0 comments on commit 6f3fea9

Please sign in to comment.