mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-09-22 03:33:06 +08:00
fix: user info not be revived after refresh (#1157)
This commit is contained in:
@@ -30,6 +30,7 @@ export const WorkspaceAvatar = (props: IWorkspaceAvatar) => {
|
|||||||
style={{ width: sizeStr, height: sizeStr }}
|
style={{ width: sizeStr, height: sizeStr }}
|
||||||
src={props.avatar}
|
src={props.avatar}
|
||||||
alt=""
|
alt=""
|
||||||
|
referrerPolicy="no-referrer"
|
||||||
/>
|
/>
|
||||||
</picture>
|
</picture>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -4,7 +4,6 @@ import { WorkspaceUnit } from '@affine/datacenter';
|
|||||||
import { useTranslation } from '@affine/i18n';
|
import { useTranslation } from '@affine/i18n';
|
||||||
export const ExportPage = ({ workspace }: { workspace: WorkspaceUnit }) => {
|
export const ExportPage = ({ workspace }: { workspace: WorkspaceUnit }) => {
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
console.log(workspace);
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<Wrapper marginBottom="42px"> {t('Export Description')}</Wrapper>
|
<Wrapper marginBottom="42px"> {t('Export Description')}</Wrapper>
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ export const StyledSettingContainer = styled('div')(() => {
|
|||||||
return {
|
return {
|
||||||
display: 'flex',
|
display: 'flex',
|
||||||
flexDirection: 'column',
|
flexDirection: 'column',
|
||||||
padding: '48px 0 20px 48px',
|
padding: '48px 0 0 48px',
|
||||||
height: 'calc(100vh - 60px)',
|
height: 'calc(100vh - 60px)',
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -144,6 +144,17 @@ export function useDataCenterPublicWorkspace(workspaceId: string | null) {
|
|||||||
|
|
||||||
export function DataCenterPreloader({ children }: React.PropsWithChildren) {
|
export function DataCenterPreloader({ children }: React.PropsWithChildren) {
|
||||||
const api = useGlobalStateApi();
|
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
|
//# region effect for updating workspace page list
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
return api.subscribe(
|
return api.subscribe(
|
||||||
|
|||||||
Reference in New Issue
Block a user