mirror of
https://github.com/usememos/memos.git
synced 2025-06-05 22:09:59 +02:00
chore: update signin button in visitor mode
This commit is contained in:
@ -1,10 +1,21 @@
|
||||
import { useEffect, useState } from "react";
|
||||
import { appRouterSwitch } from "./routers";
|
||||
import { locationService } from "./services";
|
||||
import { useAppSelector } from "./store";
|
||||
|
||||
function App() {
|
||||
const pathname = useAppSelector((state) => state.location.pathname);
|
||||
const [isLoading, setLoading] = useState(true);
|
||||
|
||||
return <>{appRouterSwitch(pathname)}</>;
|
||||
useEffect(() => {
|
||||
locationService.updateStateWithLocation();
|
||||
window.onpopstate = () => {
|
||||
locationService.updateStateWithLocation();
|
||||
};
|
||||
setLoading(false);
|
||||
}, []);
|
||||
|
||||
return <>{isLoading ? null : appRouterSwitch(pathname)}</>;
|
||||
}
|
||||
|
||||
export default App;
|
||||
|
Reference in New Issue
Block a user