mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2024-11-25 03:06:31 -05:00
fix(frontend): show reconnect alert only if note has been loaded
Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de>
This commit is contained in:
parent
1045f34d7d
commit
38b5300ea4
1 changed files with 16 additions and 1 deletions
|
@ -16,6 +16,21 @@ import React from 'react'
|
||||||
*/
|
*/
|
||||||
export const EditorAppBar: React.FC = () => {
|
export const EditorAppBar: React.FC = () => {
|
||||||
const isSynced = useApplicationState((state) => state.realtimeStatus.isSynced)
|
const isSynced = useApplicationState((state) => state.realtimeStatus.isSynced)
|
||||||
|
const noteDetailsExist = useApplicationState((state) => !!state.noteDetails)
|
||||||
|
|
||||||
return <BaseAppBar>{isSynced ? <NoteTitleElement /> : <RealtimeConnectionAlert />}</BaseAppBar>
|
if (!noteDetailsExist) {
|
||||||
|
return <BaseAppBar />
|
||||||
|
} else if (isSynced) {
|
||||||
|
return (
|
||||||
|
<BaseAppBar>
|
||||||
|
<NoteTitleElement />
|
||||||
|
</BaseAppBar>
|
||||||
|
)
|
||||||
|
} else {
|
||||||
|
return (
|
||||||
|
<BaseAppBar>
|
||||||
|
<RealtimeConnectionAlert />
|
||||||
|
</BaseAppBar>
|
||||||
|
)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue