mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-12 04:18:54 +00:00
refactor(hooks): reduce null types (#3111)
(cherry picked from commit 8b5d997322)
This commit is contained in:
@@ -30,7 +30,7 @@ export const WorkspaceDeleteModal = ({
|
||||
onDeleteWorkspace,
|
||||
}: WorkspaceDeleteProps) => {
|
||||
const [workspaceName] = useBlockSuiteWorkspaceName(
|
||||
workspace.blockSuiteWorkspace ?? null
|
||||
workspace.blockSuiteWorkspace
|
||||
);
|
||||
const [deleteStr, setDeleteStr] = useState<string>('');
|
||||
const allowDelete = deleteStr === workspaceName;
|
||||
|
||||
@@ -15,7 +15,7 @@ import {
|
||||
} from './styles';
|
||||
|
||||
export type WorkspaceSelectorProps = {
|
||||
currentWorkspace: AllWorkspace | null;
|
||||
currentWorkspace: AllWorkspace;
|
||||
onClick: () => void;
|
||||
};
|
||||
|
||||
@@ -28,7 +28,7 @@ export const WorkspaceSelector: React.FC<WorkspaceSelectorProps> = ({
|
||||
onClick,
|
||||
}) => {
|
||||
const [name] = useBlockSuiteWorkspaceName(
|
||||
currentWorkspace?.blockSuiteWorkspace ?? null
|
||||
currentWorkspace?.blockSuiteWorkspace
|
||||
);
|
||||
const [workspace] = useCurrentWorkspace();
|
||||
|
||||
|
||||
@@ -37,7 +37,7 @@ export type RootAppSidebarProps = {
|
||||
onOpenQuickSearchModal: () => void;
|
||||
onOpenSettingModal: () => void;
|
||||
onOpenWorkspaceListModal: () => void;
|
||||
currentWorkspace: AllWorkspace | null;
|
||||
currentWorkspace: AllWorkspace;
|
||||
openPage: (pageId: string) => void;
|
||||
createPage: () => Page;
|
||||
currentPath: string;
|
||||
|
||||
Reference in New Issue
Block a user