mirror of
https://github.com/naturalcrit/homebrewery.git
synced 2026-01-08 14:02:41 +00:00
Update adminPage storage keys
This commit is contained in:
@@ -7,15 +7,17 @@ import LockTools from './lockTools/lockTools.jsx';
|
|||||||
|
|
||||||
const tabGroups = ['brew', 'notifications', 'authors', 'locks'];
|
const tabGroups = ['brew', 'notifications', 'authors', 'locks'];
|
||||||
|
|
||||||
|
const ADMIN_TAB = 'hbAdminTab';
|
||||||
|
|
||||||
const Admin = ()=>{
|
const Admin = ()=>{
|
||||||
const [currentTab, setCurrentTab] = useState('');
|
const [currentTab, setCurrentTab] = useState('');
|
||||||
|
|
||||||
useEffect(()=>{
|
useEffect(()=>{
|
||||||
setCurrentTab(localStorage.getItem('hbAdminTab') || 'brew');
|
setCurrentTab(localStorage.getItem(ADMIN_TAB) || 'brew');
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
useEffect(()=>{
|
useEffect(()=>{
|
||||||
localStorage.setItem('hbAdminTab', currentTab);
|
localStorage.setItem(ADMIN_TAB, currentTab);
|
||||||
}, [currentTab]);
|
}, [currentTab]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
|||||||
Reference in New Issue
Block a user