mirror of
https://github.com/usememos/memos.git
synced 2024-12-26 07:01:17 +08:00
chore: fix user checks
This commit is contained in:
parent
fe01d68d2a
commit
09586d032c
1 changed files with 2 additions and 2 deletions
|
@ -1,5 +1,5 @@
|
|||
import { User, User_Role } from "@/types/proto/api/v1/user_service";
|
||||
|
||||
export const isSuperUser = (user: User) => {
|
||||
return user.role === User_Role.ADMIN || user.role === User_Role.HOST;
|
||||
export const isSuperUser = (user: User | undefined) => {
|
||||
return user && (user.role === User_Role.ADMIN || user.role === User_Role.HOST);
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue