fix: show new note button only dependent on guest access

Signed-off-by: Erik Michelson <github@erik.michelson.eu>
This commit is contained in:
Erik Michelson 2023-10-07 12:01:31 +02:00 committed by Philip Molares
parent 170977baa9
commit 8e10fb6804
4 changed files with 32 additions and 5 deletions

View file

@ -0,0 +1,14 @@
/*
* SPDX-FileCopyrightText: 2023 The HedgeDoc developers (see AUTHORS file)
*
* SPDX-License-Identifier: AGPL-3.0-only
*/
import { useApplicationState } from './use-application-state'
/**
* Hook to check if currently a user is logged in.
* @return True, if a user is logged in. False otherwise.
*/
export const useIsLoggedIn = () => {
return useApplicationState((state) => !!state.user)
}