chore: fix user checks

This commit is contained in:
johnnyjoy 2024-09-03 20:48:23 +08:00
parent fe01d68d2a
commit 09586d032c

View file

@ -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);
};