mirror of
https://github.com/umami-software/umami.git
synced 2026-02-08 14:47:14 +01:00
Refactored update notice. Fixes #2124.
This commit is contained in:
parent
ba9ddcac38
commit
f35d0f65dc
4 changed files with 15 additions and 13 deletions
|
|
@ -11,17 +11,14 @@ import styles from './AppLayout.module.css';
|
|||
export function AppLayout({ title, children }) {
|
||||
const { user } = useRequireLogin();
|
||||
const config = useConfig();
|
||||
const { pathname } = useRouter();
|
||||
|
||||
if (!user || !config) {
|
||||
return null;
|
||||
}
|
||||
|
||||
const allowUpdate = user?.isAdmin && !config?.updatesDisabled && !pathname.includes('/share/');
|
||||
|
||||
return (
|
||||
<div className={styles.layout} data-app-version={CURRENT_VERSION}>
|
||||
{allowUpdate && <UpdateNotice />}
|
||||
<UpdateNotice user={user} config={config} />
|
||||
<Head>
|
||||
<title>{title ? `${title} | umami` : 'umami'}</title>
|
||||
</Head>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue