mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-07-22 04:26:23 +08:00
chore: remove currentWorkspaceId & currentMetaWorkspace
This commit is contained in:
@@ -7,7 +7,7 @@ import usePageHelper from '@/hooks/use-page-helper';
|
||||
|
||||
const WorkspaceIndex = () => {
|
||||
const router = useRouter();
|
||||
const { currentWorkspaceId, currentWorkspace } = useAppState();
|
||||
const { currentWorkspace } = useAppState();
|
||||
const { createPage } = usePageHelper();
|
||||
const { workspaceLoaded, activeWorkspaceId } = useEnsureWorkspace();
|
||||
|
||||
@@ -29,7 +29,6 @@ const WorkspaceIndex = () => {
|
||||
initPage();
|
||||
}, [
|
||||
currentWorkspace,
|
||||
currentWorkspaceId,
|
||||
createPage,
|
||||
router,
|
||||
workspaceLoaded,
|
||||
|
||||
@@ -60,7 +60,7 @@ const tabMap: {
|
||||
];
|
||||
|
||||
const WorkspaceSetting = () => {
|
||||
const { currentMetaWorkSpace } = useAppState();
|
||||
const { currentWorkspace } = useAppState();
|
||||
|
||||
const [activeTab, setActiveTab] = useState<TabNames>(tabMap[0].name);
|
||||
const handleTabChange = (tab: TabNames) => {
|
||||
@@ -98,7 +98,7 @@ const WorkspaceSetting = () => {
|
||||
</StyledSettingSidebar>
|
||||
|
||||
<StyledSettingContent>
|
||||
{currentMetaWorkSpace && activeTabPanelRender?.(currentMetaWorkSpace)}
|
||||
{currentWorkspace && activeTabPanelRender?.(currentWorkspace)}
|
||||
</StyledSettingContent>
|
||||
</StyledSettingContainer>
|
||||
);
|
||||
|
||||
@@ -6,14 +6,14 @@ import { PageLoading } from '@/components/loading';
|
||||
|
||||
export const WorkspaceIndex = () => {
|
||||
const router = useRouter();
|
||||
const { currentWorkspaceId } = useAppState();
|
||||
const { currentWorkspace } = useAppState();
|
||||
const { workspaceLoaded } = useEnsureWorkspace();
|
||||
|
||||
useEffect(() => {
|
||||
if (workspaceLoaded) {
|
||||
router.push(`/workspace/${currentWorkspaceId}`);
|
||||
router.push(`/workspace/${currentWorkspace?.id}`);
|
||||
}
|
||||
}, [currentWorkspaceId, router, workspaceLoaded]);
|
||||
}, [currentWorkspace, router, workspaceLoaded]);
|
||||
|
||||
return <PageLoading />;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user