mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-09-06 08:50:50 +08:00
chore: remove isolated ts file
This commit is contained in:
@@ -1,35 +0,0 @@
|
|||||||
// import { useRef } from 'react';
|
|
||||||
// import { AppStateContext } from '@/providers/app-state-provider';
|
|
||||||
//
|
|
||||||
// export const useLoadWorkspace = ({}:{
|
|
||||||
// state,
|
|
||||||
// loadWorkspaceHandler
|
|
||||||
// }) => {
|
|
||||||
// const loadWorkspace = useRef<AppStateContext['loadWorkspace']>(() =>
|
|
||||||
// Promise.resolve(null)
|
|
||||||
// );
|
|
||||||
// loadWorkspace.current = async (workspaceId: string) => {
|
|
||||||
// if (state.currentWorkspaceId === workspaceId) {
|
|
||||||
// return state.currentWorkspace;
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// const workspace =
|
|
||||||
// (await loadWorkspaceHandler?.(workspaceId, true, state.user)) || null;
|
|
||||||
//
|
|
||||||
// // eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
||||||
// // @ts-expect-error
|
|
||||||
// window.workspace = workspace;
|
|
||||||
// // FIXME: there needs some method to destroy websocket.
|
|
||||||
// // Or we need a manager to manage websocket.
|
|
||||||
// // eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
||||||
// // @ts-expect-error
|
|
||||||
// state.currentWorkspace?.__ws__?.destroy();
|
|
||||||
//
|
|
||||||
// setState(state => ({
|
|
||||||
// ...state,
|
|
||||||
// currentWorkspace: workspace,
|
|
||||||
// currentWorkspaceId: workspaceId,
|
|
||||||
// }));
|
|
||||||
// return workspace;
|
|
||||||
// };
|
|
||||||
// };
|
|
||||||
Reference in New Issue
Block a user