fix: dispatch workspace change event (#2261)

This commit is contained in:
Himself65
2023-05-08 14:47:47 +08:00
committed by GitHub
parent a942add87a
commit f1c3d575ad
2 changed files with 18 additions and 11 deletions
-11
View File
@@ -37,7 +37,6 @@ import { useSyncRouterWithCurrentWorkspaceId } from '../hooks/use-sync-router-wi
import { useWorkspaces } from '../hooks/use-workspaces';
import { WorkspacePlugins } from '../plugins';
import { ModalProvider } from '../providers/ModalProvider';
import type { AllWorkspace } from '../shared';
import { pathGenerator, publicPathGenerator } from '../shared';
import {
MainContainer,
@@ -46,11 +45,6 @@ import {
StyledToolWrapper,
} from './styles';
declare global {
// eslint-disable-next-line no-var
var currentWorkspace: AllWorkspace;
}
const QuickSearchModal = lazy(() =>
import('../components/pure/quick-search-modal').then(module => ({
default: module.QuickSearchModal,
@@ -260,11 +254,6 @@ export const WorkspaceLayoutInner: FC<PropsWithChildren> = ({ children }) => {
const { jumpToPage } = useRouterHelper(router);
const t = useAFFiNEI18N();
useEffect(() => {
logger.info('currentWorkspace: ', currentWorkspace);
globalThis.currentWorkspace = currentWorkspace;
}, [currentWorkspace]);
//#region init workspace
if (currentWorkspace.blockSuiteWorkspace.isEmpty) {
// this is a new workspace, so we should redirect to the new page