Skip to content

armgit / memos

Public Imported from GitHub
0

Memos is an open-source, self-hosted note-taking app that brings your everyday thoughts together in a personal timeline. Your data stays yours, and you choose what to keep private or share.

fix: load server name and icon from settings (#3908)

RoccoSmit42bc769d5d8f
diff --git a/web/src/components/UserBanner.tsx b/web/src/components/UserBanner.tsx
index 0962a0863..a02af9695 100644
--- a/web/src/components/UserBanner.tsx
+++ b/web/src/components/UserBanner.tsx
@@ -5,6 +5,9 @@ import { authServiceClient } from "@/grpcweb";
import useCurrentUser from "@/hooks/useCurrentUser";
import useNavigateTo from "@/hooks/useNavigateTo";
import { Routes } from "@/router";
+import { useWorkspaceSettingStore } from "@/store/v1";
+import { WorkspaceGeneralSetting } from "@/types/proto/api/v1/workspace_setting_service";
+import { WorkspaceSettingKey } from "@/types/proto/store/workspace_setting";
import { useTranslate } from "@/utils/i18n";
import UserAvatar from "./UserAvatar";
@@ -17,8 +20,11 @@ const UserBanner = (props: Props) => {
const t = useTranslate();
const navigateTo = useNavigateTo();
const user = useCurrentUser();
- const title = user ? user.nickname || user.username : "Memos";
- const avatarUrl = user ? user.avatarUrl : "/full-logo.webp";
+ const workspaceSettingStore = useWorkspaceSettingStore();
+ const workspaceGeneralSetting =
+ workspaceSettingStore.getWorkspaceSettingByKey(WorkspaceSettingKey.GENERAL).generalSetting || WorkspaceGeneralSetting.fromPartial({});
+ const title = user ? user.nickname || user.username : workspaceGeneralSetting.customProfile?.title;
+ const avatarUrl = user ? user.avatarUrl : workspaceGeneralSetting.customProfile?.logoUrl;
const handleSignOut = async () => {
await authServiceClient.signOut({});