Skip to content

Commit d1a9aa4

Browse files
committed
better name rendering
1 parent 51cc33c commit d1a9aa4

File tree

1 file changed

+3
-3
lines changed
  • apps/desktop/src/components/main/sidebar/profile

1 file changed

+3
-3
lines changed

apps/desktop/src/components/main/sidebar/profile/index.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,7 @@ function ProfileButton({
242242
onClick: () => void;
243243
}) {
244244
const auth = useAuth();
245-
const name = useMyName();
245+
const name = useMyName(auth?.session?.user.email);
246246

247247
const profile = useQuery({
248248
queryKey: ["profile"],
@@ -298,8 +298,8 @@ function ProfileButton({
298298
);
299299
}
300300

301-
function useMyName() {
301+
function useMyName(email?: string) {
302302
const userId = main.UI.useValue("user_id", main.STORE_ID);
303303
const name = main.UI.useCell("humans", userId ?? "", "name", main.STORE_ID);
304-
return name || "Unknown";
304+
return name || email || "Unknown";
305305
}

0 commit comments

Comments
 (0)