mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2025-05-23 11:37:02 -04:00
fix: show new note button only dependent on guest access
Signed-off-by: Erik Michelson <github@erik.michelson.eu>
This commit is contained in:
parent
170977baa9
commit
8e10fb6804
4 changed files with 32 additions and 5 deletions
14
frontend/src/hooks/common/use-is-logged-in.ts
Normal file
14
frontend/src/hooks/common/use-is-logged-in.ts
Normal 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)
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue