diff --git a/cms/admin/src/App.jsx b/cms/admin/src/App.jsx index 17aed88..c2469d3 100644 --- a/cms/admin/src/App.jsx +++ b/cms/admin/src/App.jsx @@ -72,13 +72,14 @@ function Dashboard({ email }) { const [current, setCurrent] = useState(null); const [query, setQuery] = useState(''); const [view, setView] = useState('content'); + const [me, setMe] = useState(null); const [msg, setMsg] = useState(null); async function refresh() { try { setEntries(await api.list()); } catch (e) { setMsg({ type: 'err', text: e.message }); } } - useEffect(() => { refresh(); }, []); + useEffect(() => { refresh(); api.getMe().then(setMe).catch(() => {}); }, []); useEffect(() => { if (!msg) return; const t = setTimeout(() => setMsg(null), 4000); return () => clearTimeout(t); }, [msg]); async function open(entry) { @@ -99,6 +100,7 @@ function Dashboard({ email }) { {email} @@ -108,6 +110,8 @@ function Dashboard({ email }) {
{view === 'profile' ? ( + ) : view === 'users' ? ( + ) : ( <>