mirror of
https://github.com/usememos/memos.git
synced 2025-06-05 22:09:59 +02:00
fix: invalid username checks
This commit is contained in:
@ -5,7 +5,7 @@ import { useUserV1Store } from "@/store/v1";
|
||||
const useCurrentUser = () => {
|
||||
const userStore = useUserStore();
|
||||
const userV1Store = useUserV1Store();
|
||||
const currentUsername = userStore.getCurrentUsername();
|
||||
const currentUsername = userStore.state.user?.username;
|
||||
|
||||
useEffect(() => {
|
||||
if (currentUsername) {
|
||||
@ -13,7 +13,7 @@ const useCurrentUser = () => {
|
||||
}
|
||||
}, [currentUsername]);
|
||||
|
||||
return userV1Store.getUserByUsername(currentUsername);
|
||||
return userV1Store.getUserByUsername(currentUsername || "");
|
||||
};
|
||||
|
||||
export default useCurrentUser;
|
||||
|
Reference in New Issue
Block a user