mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-25 02:13:00 +08:00
fix(core): correct the suspense behavior (#3789)
This commit is contained in:
@@ -1,10 +1,11 @@
|
|||||||
import {
|
import {
|
||||||
SettingModal as SettingModalBase,
|
SettingModal as SettingModalBase,
|
||||||
type SettingModalProps as SettingModalBaseProps,
|
type SettingModalProps as SettingModalBaseProps,
|
||||||
|
WorkspaceDetailSkeleton,
|
||||||
} from '@affine/component/setting-components';
|
} from '@affine/component/setting-components';
|
||||||
import { useAFFiNEI18N } from '@affine/i18n/hooks';
|
import { useAFFiNEI18N } from '@affine/i18n/hooks';
|
||||||
import { ContactWithUsIcon } from '@blocksuite/icons';
|
import { ContactWithUsIcon } from '@blocksuite/icons';
|
||||||
import { useCallback } from 'react';
|
import { Suspense, useCallback } from 'react';
|
||||||
|
|
||||||
import { AccountSetting } from './account-setting';
|
import { AccountSetting } from './account-setting';
|
||||||
import {
|
import {
|
||||||
@@ -77,7 +78,9 @@ export const SettingModal = ({
|
|||||||
<div className="wrapper">
|
<div className="wrapper">
|
||||||
<div className="content">
|
<div className="content">
|
||||||
{activeTab === 'workspace' && workspaceId ? (
|
{activeTab === 'workspace' && workspaceId ? (
|
||||||
<WorkspaceSetting key={workspaceId} workspaceId={workspaceId} />
|
<Suspense fallback={<WorkspaceDetailSkeleton />}>
|
||||||
|
<WorkspaceSetting key={workspaceId} workspaceId={workspaceId} />
|
||||||
|
</Suspense>
|
||||||
) : null}
|
) : null}
|
||||||
{generalSettingList.find(v => v.key === activeTab) ? (
|
{generalSettingList.find(v => v.key === activeTab) ? (
|
||||||
<GeneralSetting generalKey={activeTab as GeneralSettingKeys} />
|
<GeneralSetting generalKey={activeTab as GeneralSettingKeys} />
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
import { WorkspaceDetailSkeleton } from '@affine/component/setting-components';
|
|
||||||
import { usePassiveWorkspaceEffect } from '@toeverything/infra/__internal__/react';
|
import { usePassiveWorkspaceEffect } from '@toeverything/infra/__internal__/react';
|
||||||
import { useSetAtom } from 'jotai';
|
import { useSetAtom } from 'jotai';
|
||||||
import { Suspense, useCallback } from 'react';
|
import { useCallback } from 'react';
|
||||||
|
|
||||||
import { getUIAdapter } from '../../../../adapters/workspace';
|
import { getUIAdapter } from '../../../../adapters/workspace';
|
||||||
import { openSettingModalAtom } from '../../../../atoms';
|
import { openSettingModalAtom } from '../../../../atoms';
|
||||||
@@ -33,12 +32,10 @@ export const WorkspaceSetting = ({ workspaceId }: { workspaceId: string }) => {
|
|||||||
const onTransformWorkspace = useOnTransformWorkspace();
|
const onTransformWorkspace = useOnTransformWorkspace();
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Suspense fallback={<WorkspaceDetailSkeleton />}>
|
<NewSettingsDetail
|
||||||
<NewSettingsDetail
|
onTransformWorkspace={onTransformWorkspace}
|
||||||
onTransformWorkspace={onTransformWorkspace}
|
onDeleteWorkspace={onDeleteWorkspace}
|
||||||
onDeleteWorkspace={onDeleteWorkspace}
|
currentWorkspaceId={workspaceId}
|
||||||
currentWorkspaceId={workspaceId}
|
/>
|
||||||
/>
|
|
||||||
</Suspense>
|
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user