mirror of
https://github.com/kremalicious/umami.git
synced 2024-12-22 09:13:37 +01:00
share page loading
since there isn't a spinner, just returning null, just like pages/dashboard.js
This commit is contained in:
parent
8d27a0a846
commit
0787818bc8
@ -6,6 +6,7 @@ import NotFound from 'pages/404';
|
||||
import { get } from 'lib/web';
|
||||
|
||||
export default function SharePage() {
|
||||
const [loading, setLoading] = useState(true);
|
||||
const [websiteId, setWebsiteId] = useState();
|
||||
const [notFound, setNotFound] = useState(false);
|
||||
const router = useRouter();
|
||||
@ -23,10 +24,16 @@ export default function SharePage() {
|
||||
|
||||
useEffect(() => {
|
||||
if (id) {
|
||||
loadData();
|
||||
loadData().finally(() => {
|
||||
setLoading(false);
|
||||
});
|
||||
} else {
|
||||
setLoading(false);
|
||||
}
|
||||
}, [id]);
|
||||
|
||||
if (loading) return null;
|
||||
|
||||
if (!id || notFound) {
|
||||
return <NotFound />;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user