Skip to content

There can be more than Notion and Miro. AFFiNE(pronounced [ə‘fain]) is a next-gen knowledge base that brings planning, sorting and creating all together. Privacy first, open-source, customizable and ready to use.

fix: user info not be revived after refresh (#1157)

Peng Xiaofd47fe3fc1ee
diff --git a/apps/web/src/components/workspace-avatar/Avatar.tsx b/apps/web/src/components/workspace-avatar/Avatar.tsx
index f62215ebce..a83865761d 100644
--- a/apps/web/src/components/workspace-avatar/Avatar.tsx
+++ b/apps/web/src/components/workspace-avatar/Avatar.tsx
@@ -30,6 +30,7 @@ export const WorkspaceAvatar = (props: IWorkspaceAvatar) => {
style={{ width: sizeStr, height: sizeStr }}
src={props.avatar}
alt=""
+ referrerPolicy="no-referrer"
/>
</picture>
</div>
diff --git a/apps/web/src/components/workspace-setting/ExportPage.tsx b/apps/web/src/components/workspace-setting/ExportPage.tsx
index a9f18c0136..61f1d9d94c 100644
--- a/apps/web/src/components/workspace-setting/ExportPage.tsx
+++ b/apps/web/src/components/workspace-setting/ExportPage.tsx
@@ -4,7 +4,6 @@ import { WorkspaceUnit } from '@affine/datacenter';
import { useTranslation } from '@affine/i18n';
export const ExportPage = ({ workspace }: { workspace: WorkspaceUnit }) => {
const { t } = useTranslation();
- console.log(workspace);
return (
<>
<Wrapper marginBottom="42px"> {t('Export Description')}</Wrapper>
diff --git a/apps/web/src/components/workspace-setting/style.ts b/apps/web/src/components/workspace-setting/style.ts
index d6ed7e7f64..bc0b49a863 100644
--- a/apps/web/src/components/workspace-setting/style.ts
+++ b/apps/web/src/components/workspace-setting/style.ts
@@ -4,7 +4,7 @@ export const StyledSettingContainer = styled('div')(() => {
return {
display: 'flex',
flexDirection: 'column',
- padding: '48px 0 20px 48px',
+ padding: '48px 0 0 48px',
height: 'calc(100vh - 60px)',
};
});
diff --git a/packages/store/src/app/datacenter/index.tsx b/packages/store/src/app/datacenter/index.tsx
index 4d92254924..e98c2c68b6 100644
--- a/packages/store/src/app/datacenter/index.tsx
+++ b/packages/store/src/app/datacenter/index.tsx
@@ -144,6 +144,17 @@ export function useDataCenterPublicWorkspace(workspaceId: string | null) {
export function DataCenterPreloader({ children }: React.PropsWithChildren) {
const api = useGlobalStateApi();
+
+ // init user info from datacenter
+ useEffect(() => {
+ dataCenterPromise.then(async dataCenter => {
+ const user = await dataCenter.getUserInfo();
+ if (!api.getState().user) {
+ api.setState({ user });
+ }
+ });
+ }, []);
+
//# region effect for updating workspace page list
useEffect(() => {
return api.subscribe(