mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-14 21:27:20 +00:00
chore: clean up runtime flags and envs (#7454)
This commit is contained in:
@@ -8,7 +8,6 @@ import type { ActiveTab } from '../components/affine/setting-modal/types';
|
||||
export const openWorkspacesModalAtom = atom(false);
|
||||
export const openCreateWorkspaceModalAtom = atom<CreateWorkspaceMode>(false);
|
||||
export const openSignOutModalAtom = atom(false);
|
||||
export const openPaymentDisableAtom = atom(false);
|
||||
export const openQuotaModalAtom = atom(false);
|
||||
export const openStarAFFiNEModalAtom = atom(false);
|
||||
export const openIssueFeedbackModalAtom = atom(false);
|
||||
@@ -51,8 +50,6 @@ export const authAtom = atom<AuthAtom>({
|
||||
emailType: 'changeEmail',
|
||||
});
|
||||
|
||||
export const openDisableCloudAlertModalAtom = atom(false);
|
||||
|
||||
export type AllPageFilterOption = 'docs' | 'collections' | 'tags';
|
||||
export const allPageFilterSelectAtom = atom<AllPageFilterOption>('docs');
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { Avatar, Input, Switch, toast } from '@affine/component';
|
||||
import type { ConfirmModalProps } from '@affine/component/ui/modal';
|
||||
import { ConfirmModal, Modal } from '@affine/component/ui/modal';
|
||||
import { authAtom, openDisableCloudAlertModalAtom } from '@affine/core/atoms';
|
||||
import { authAtom } from '@affine/core/atoms';
|
||||
import { useAsyncCallback } from '@affine/core/hooks/affine-async-hooks';
|
||||
import { DebugLogger } from '@affine/debug';
|
||||
import { apis } from '@affine/electron-api';
|
||||
@@ -61,20 +61,14 @@ const NameWorkspaceContent = ({
|
||||
const session = useService(AuthService).session;
|
||||
const loginStatus = useLiveData(session.status$);
|
||||
|
||||
const setDisableCloudOpen = useSetAtom(openDisableCloudAlertModalAtom);
|
||||
|
||||
const setOpenSignIn = useSetAtom(authAtom);
|
||||
|
||||
const openSignInModal = useCallback(() => {
|
||||
if (!runtimeConfig.enableCloud) {
|
||||
setDisableCloudOpen(true);
|
||||
} else {
|
||||
setOpenSignIn(state => ({
|
||||
...state,
|
||||
openModal: true,
|
||||
}));
|
||||
}
|
||||
}, [setDisableCloudOpen, setOpenSignIn]);
|
||||
setOpenSignIn(state => ({
|
||||
...state,
|
||||
openModal: true,
|
||||
}));
|
||||
}, [setOpenSignIn]);
|
||||
|
||||
const onSwitchChange = useCallback(
|
||||
(checked: boolean) => {
|
||||
|
||||
@@ -1,12 +1,9 @@
|
||||
import { OverlayModal } from '@affine/component';
|
||||
import {
|
||||
openDisableCloudAlertModalAtom,
|
||||
openHistoryTipsModalAtom,
|
||||
} from '@affine/core/atoms';
|
||||
import { openHistoryTipsModalAtom } from '@affine/core/atoms';
|
||||
import { useEnableCloud } from '@affine/core/hooks/affine/use-enable-cloud';
|
||||
import { useI18n } from '@affine/i18n';
|
||||
import { useService, WorkspaceService } from '@toeverything/infra';
|
||||
import { useAtom, useSetAtom } from 'jotai';
|
||||
import { useAtom } from 'jotai';
|
||||
import { useCallback } from 'react';
|
||||
|
||||
import TopSvg from './top-svg';
|
||||
@@ -15,17 +12,12 @@ export const HistoryTipsModal = () => {
|
||||
const t = useI18n();
|
||||
const currentWorkspace = useService(WorkspaceService).workspace;
|
||||
const [open, setOpen] = useAtom(openHistoryTipsModalAtom);
|
||||
const setTempDisableCloudOpen = useSetAtom(openDisableCloudAlertModalAtom);
|
||||
const confirmEnableCloud = useEnableCloud();
|
||||
|
||||
const handleConfirm = useCallback(() => {
|
||||
setOpen(false);
|
||||
if (runtimeConfig.enableCloud) {
|
||||
confirmEnableCloud(currentWorkspace);
|
||||
return;
|
||||
}
|
||||
return setTempDisableCloudOpen(true);
|
||||
}, [confirmEnableCloud, currentWorkspace, setOpen, setTempDisableCloudOpen]);
|
||||
confirmEnableCloud(currentWorkspace);
|
||||
}, [confirmEnableCloud, currentWorkspace, setOpen]);
|
||||
|
||||
return (
|
||||
<OverlayModal
|
||||
|
||||
@@ -1,35 +0,0 @@
|
||||
import { ConfirmModal } from '@affine/component/ui/modal';
|
||||
import { useI18n } from '@affine/i18n';
|
||||
import { useAtom } from 'jotai';
|
||||
import { useCallback } from 'react';
|
||||
|
||||
import { openPaymentDisableAtom } from '../../../atoms';
|
||||
import * as styles from './style.css';
|
||||
|
||||
export const PaymentDisableModal = () => {
|
||||
const [open, setOpen] = useAtom(openPaymentDisableAtom);
|
||||
const t = useI18n();
|
||||
|
||||
const onClickCancel = useCallback(() => {
|
||||
setOpen(false);
|
||||
}, [setOpen]);
|
||||
|
||||
return (
|
||||
<ConfirmModal
|
||||
title={t['com.affine.payment.disable-payment.title']()}
|
||||
cancelText=""
|
||||
cancelButtonOptions={{ style: { display: 'none' } }}
|
||||
confirmButtonOptions={{
|
||||
type: 'primary',
|
||||
children: t['Got it'](),
|
||||
}}
|
||||
onConfirm={onClickCancel}
|
||||
open={open}
|
||||
onOpenChange={setOpen}
|
||||
>
|
||||
<p className={styles.paymentDisableModalContent}>
|
||||
{t['com.affine.payment.disable-payment.description']()}
|
||||
</p>
|
||||
</ConfirmModal>
|
||||
);
|
||||
};
|
||||
@@ -1,5 +0,0 @@
|
||||
import { cssVar } from '@toeverything/theme';
|
||||
import { style } from '@vanilla-extract/css';
|
||||
export const paymentDisableModalContent = style({
|
||||
color: cssVar('textPrimaryColor'),
|
||||
});
|
||||
@@ -9,12 +9,11 @@ import { Trans, useI18n } from '@affine/i18n';
|
||||
import { DoneIcon } from '@blocksuite/icons/rc';
|
||||
import { useLiveData, useService } from '@toeverything/infra';
|
||||
import clsx from 'clsx';
|
||||
import { useAtom, useSetAtom } from 'jotai';
|
||||
import { useSetAtom } from 'jotai';
|
||||
import { nanoid } from 'nanoid';
|
||||
import type { HTMLAttributes, PropsWithChildren } from 'react';
|
||||
import { useCallback, useEffect, useMemo, useState } from 'react';
|
||||
|
||||
import { openPaymentDisableAtom } from '../../../../../atoms';
|
||||
import { authAtom } from '../../../../../atoms/index';
|
||||
import { mixpanel } from '../../../../../utils';
|
||||
import { CancelAction, ResumeAction } from './actions';
|
||||
@@ -280,13 +279,7 @@ export const Upgrade = ({
|
||||
return;
|
||||
}, [isOpenedExternalWindow, subscriptionService]);
|
||||
|
||||
const [, openPaymentDisableModal] = useAtom(openPaymentDisableAtom);
|
||||
const upgrade = useAsyncCallback(async () => {
|
||||
if (!runtimeConfig.enablePayment) {
|
||||
openPaymentDisableModal(true);
|
||||
return;
|
||||
}
|
||||
|
||||
setMutating(true);
|
||||
mixpanel.track('PlanUpgradeStarted', {
|
||||
segment: 'settings panel',
|
||||
@@ -306,7 +299,7 @@ export const Upgrade = ({
|
||||
setIdempotencyKey(nanoid());
|
||||
popupWindow(link);
|
||||
setOpenedExternalWindow(true);
|
||||
}, [openPaymentDisableModal, subscriptionService, recurring, idempotencyKey]);
|
||||
}, [subscriptionService, recurring, idempotencyKey]);
|
||||
|
||||
return (
|
||||
<Button
|
||||
|
||||
@@ -196,11 +196,8 @@ export const SettingSidebar = ({
|
||||
</div>
|
||||
|
||||
<div className={style.sidebarFooter}>
|
||||
{runtimeConfig.enableCloud && loginStatus === 'unauthenticated' ? (
|
||||
<SignInButton />
|
||||
) : null}
|
||||
|
||||
{runtimeConfig.enableCloud && loginStatus === 'authenticated' ? (
|
||||
{loginStatus === 'unauthenticated' ? <SignInButton /> : null}
|
||||
{loginStatus === 'authenticated' ? (
|
||||
<Suspense>
|
||||
<UserInfo
|
||||
onAccountSettingClick={onAccountSettingClick}
|
||||
|
||||
@@ -11,10 +11,9 @@ import {
|
||||
WorkspaceService,
|
||||
} from '@toeverything/infra';
|
||||
import { useSetAtom } from 'jotai';
|
||||
import { useCallback, useState } from 'react';
|
||||
import { useCallback } from 'react';
|
||||
|
||||
import { openSettingModalAtom } from '../../../../../atoms';
|
||||
import { TmpDisableAffineCloudModal } from '../../../tmp-disable-affine-cloud-modal';
|
||||
|
||||
export interface PublishPanelProps {
|
||||
workspace: Workspace | null;
|
||||
@@ -30,8 +29,6 @@ export const EnableCloudPanel = () => {
|
||||
|
||||
const setSettingModal = useSetAtom(openSettingModalAtom);
|
||||
|
||||
const [open, setOpen] = useState(false);
|
||||
|
||||
const confirmEnableCloudAndClose = useCallback(() => {
|
||||
if (!workspace) return;
|
||||
confirmEnableCloud(workspace, {
|
||||
@@ -46,30 +43,25 @@ export const EnableCloudPanel = () => {
|
||||
}
|
||||
|
||||
return (
|
||||
<>
|
||||
<SettingRow
|
||||
name={t['Workspace saved locally']({
|
||||
name: name ?? UNTITLED_WORKSPACE_NAME,
|
||||
})}
|
||||
desc={t['Enable cloud hint']()}
|
||||
spreadCol={false}
|
||||
style={{
|
||||
padding: '10px',
|
||||
background: 'var(--affine-background-secondary-color)',
|
||||
}}
|
||||
<SettingRow
|
||||
name={t['Workspace saved locally']({
|
||||
name: name ?? UNTITLED_WORKSPACE_NAME,
|
||||
})}
|
||||
desc={t['Enable cloud hint']()}
|
||||
spreadCol={false}
|
||||
style={{
|
||||
padding: '10px',
|
||||
background: 'var(--affine-background-secondary-color)',
|
||||
}}
|
||||
>
|
||||
<Button
|
||||
data-testid="publish-enable-affine-cloud-button"
|
||||
type="primary"
|
||||
onClick={confirmEnableCloudAndClose}
|
||||
style={{ marginTop: '12px' }}
|
||||
>
|
||||
<Button
|
||||
data-testid="publish-enable-affine-cloud-button"
|
||||
type="primary"
|
||||
onClick={confirmEnableCloudAndClose}
|
||||
style={{ marginTop: '12px' }}
|
||||
>
|
||||
{t['Enable AFFiNE Cloud']()}
|
||||
</Button>
|
||||
</SettingRow>
|
||||
{runtimeConfig.enableCloud ? null : (
|
||||
<TmpDisableAffineCloudModal open={open} onOpenChange={setOpen} />
|
||||
)}
|
||||
</>
|
||||
{t['Enable AFFiNE Cloud']()}
|
||||
</Button>
|
||||
</SettingRow>
|
||||
);
|
||||
};
|
||||
|
||||
@@ -1,61 +0,0 @@
|
||||
import { Empty } from '@affine/component';
|
||||
import type { ModalProps } from '@affine/component/ui/modal';
|
||||
import { Modal } from '@affine/component/ui/modal';
|
||||
import { Trans, useI18n } from '@affine/i18n';
|
||||
import { useCallback } from 'react';
|
||||
|
||||
import {
|
||||
StyleButton,
|
||||
StyleButtonContainer,
|
||||
StyleImage,
|
||||
StyleTips,
|
||||
} from './style';
|
||||
|
||||
export const TmpDisableAffineCloudModal = (props: ModalProps) => {
|
||||
const t = useI18n();
|
||||
const onClose = useCallback(() => {
|
||||
props.onOpenChange?.(false);
|
||||
}, [props]);
|
||||
return (
|
||||
<Modal
|
||||
title={t['com.affine.cloudTempDisable.title']()}
|
||||
contentOptions={{
|
||||
['data-testid' as string]: 'disable-affine-cloud-modal',
|
||||
}}
|
||||
width={480}
|
||||
{...props}
|
||||
>
|
||||
<StyleTips>
|
||||
<Trans i18nKey="com.affine.cloudTempDisable.description">
|
||||
We are upgrading the AFFiNE Cloud service and it is temporarily
|
||||
unavailable on the client side. If you wish to stay updated on the
|
||||
progress and be notified on availability, you can fill out the
|
||||
<a
|
||||
href="https://6dxre9ihosp.typeform.com/to/B8IHwuyy"
|
||||
rel="noreferrer"
|
||||
target="_blank"
|
||||
style={{
|
||||
color: 'var(--affine-link-color)',
|
||||
}}
|
||||
>
|
||||
AFFiNE Cloud Signup
|
||||
</a>
|
||||
.
|
||||
</Trans>
|
||||
</StyleTips>
|
||||
<StyleImage>
|
||||
<Empty
|
||||
containerStyle={{
|
||||
width: '200px',
|
||||
height: '112px',
|
||||
}}
|
||||
/>
|
||||
</StyleImage>
|
||||
<StyleButtonContainer>
|
||||
<StyleButton type="primary" onClick={onClose}>
|
||||
{t['Got it']()}
|
||||
</StyleButton>
|
||||
</StyleButtonContainer>
|
||||
</Modal>
|
||||
);
|
||||
};
|
||||
@@ -1,54 +0,0 @@
|
||||
import { displayFlex, styled } from '@affine/component';
|
||||
import { Button } from '@affine/component/ui/button';
|
||||
|
||||
export const Header = styled('div')({
|
||||
height: '44px',
|
||||
display: 'flex',
|
||||
flexDirection: 'row-reverse',
|
||||
paddingRight: '10px',
|
||||
paddingTop: '10px',
|
||||
flexShrink: 0,
|
||||
});
|
||||
|
||||
export const Content = styled('div')({
|
||||
padding: '0 40px',
|
||||
});
|
||||
|
||||
export const ContentTitle = styled('h1')(() => {
|
||||
return {
|
||||
marginTop: 44,
|
||||
fontSize: 'var(--affine-font-h6)',
|
||||
lineHeight: '28px',
|
||||
fontWeight: 600,
|
||||
};
|
||||
});
|
||||
|
||||
export const StyleTips = styled('div')(() => {
|
||||
return {
|
||||
margin: '0 0 20px 0',
|
||||
a: {
|
||||
color: 'var(--affine-primary-color)',
|
||||
},
|
||||
};
|
||||
});
|
||||
|
||||
export const StyleButton = styled(Button)({
|
||||
textAlign: 'center',
|
||||
borderRadius: '8px',
|
||||
backgroundColor: 'var(--affine-primary-color)',
|
||||
span: {
|
||||
margin: '0',
|
||||
},
|
||||
});
|
||||
export const StyleButtonContainer = styled('div')(() => {
|
||||
return {
|
||||
width: '100%',
|
||||
marginTop: 20,
|
||||
...displayFlex('flex-end', 'center'),
|
||||
};
|
||||
});
|
||||
export const StyleImage = styled('div')(() => {
|
||||
return {
|
||||
...displayFlex('center', 'center'),
|
||||
};
|
||||
});
|
||||
@@ -245,7 +245,7 @@ export const PageHeaderMenuButton = ({
|
||||
{t['com.affine.header.option.add-tag']()}
|
||||
</MenuItem> */}
|
||||
<MenuSeparator />
|
||||
{runtimeConfig.enableInfoModal ? (
|
||||
{runtimeConfig.enableInfoModal && (
|
||||
<MenuItem
|
||||
preFix={
|
||||
<MenuIcon>
|
||||
@@ -258,21 +258,19 @@ export const PageHeaderMenuButton = ({
|
||||
>
|
||||
{t['com.affine.page-properties.page-info.view']()}
|
||||
</MenuItem>
|
||||
) : null}
|
||||
{runtimeConfig.enablePageHistory ? (
|
||||
<MenuItem
|
||||
preFix={
|
||||
<MenuIcon>
|
||||
<HistoryIcon />
|
||||
</MenuIcon>
|
||||
}
|
||||
data-testid="editor-option-menu-history"
|
||||
onSelect={openHistoryModal}
|
||||
style={menuItemStyle}
|
||||
>
|
||||
{t['com.affine.history.view-history-version']()}
|
||||
</MenuItem>
|
||||
) : null}
|
||||
)}
|
||||
<MenuItem
|
||||
preFix={
|
||||
<MenuIcon>
|
||||
<HistoryIcon />
|
||||
</MenuIcon>
|
||||
}
|
||||
data-testid="editor-option-menu-history"
|
||||
onSelect={openHistoryModal}
|
||||
style={menuItemStyle}
|
||||
>
|
||||
{t['com.affine.history.view-history-version']()}
|
||||
</MenuItem>
|
||||
<MenuSeparator />
|
||||
{!isJournal && (
|
||||
<MenuItem
|
||||
@@ -301,7 +299,6 @@ export const PageHeaderMenuButton = ({
|
||||
{t['Import']()}
|
||||
</MenuItem>
|
||||
<Export exportHandler={exportHandler} pageMode={currentMode} />
|
||||
|
||||
<MenuSeparator />
|
||||
<MoveToTrash
|
||||
data-testid="editor-option-menu-delete"
|
||||
|
||||
@@ -12,11 +12,7 @@ import {
|
||||
import { useSetAtom } from 'jotai';
|
||||
import { Suspense, useCallback } from 'react';
|
||||
|
||||
import {
|
||||
authAtom,
|
||||
openCreateWorkspaceModalAtom,
|
||||
openDisableCloudAlertModalAtom,
|
||||
} from '../../../../atoms';
|
||||
import { authAtom, openCreateWorkspaceModalAtom } from '../../../../atoms';
|
||||
import { mixpanel } from '../../../../utils';
|
||||
import { AddWorkspace } from './add-workspace';
|
||||
import * as styles from './index.css';
|
||||
@@ -24,8 +20,6 @@ import { UserAccountItem } from './user-account';
|
||||
import { AFFiNEWorkspaceList } from './workspace-list';
|
||||
|
||||
export const SignInItem = () => {
|
||||
const setDisableCloudOpen = useSetAtom(openDisableCloudAlertModalAtom);
|
||||
|
||||
const setOpen = useSetAtom(authAtom);
|
||||
|
||||
const t = useI18n();
|
||||
@@ -34,15 +28,11 @@ export const SignInItem = () => {
|
||||
mixpanel.track('Button', {
|
||||
resolve: 'SignIn',
|
||||
});
|
||||
if (!runtimeConfig.enableCloud) {
|
||||
setDisableCloudOpen(true);
|
||||
} else {
|
||||
setOpen(state => ({
|
||||
...state,
|
||||
openModal: true,
|
||||
}));
|
||||
}
|
||||
}, [setOpen, setDisableCloudOpen]);
|
||||
setOpen(state => ({
|
||||
...state,
|
||||
openModal: true,
|
||||
}));
|
||||
}, [setOpen]);
|
||||
|
||||
return (
|
||||
<MenuItem
|
||||
@@ -88,20 +78,15 @@ const UserWithWorkspaceListInner = ({
|
||||
const isAuthenticated = session.status === 'authenticated';
|
||||
|
||||
const setOpenCreateWorkspaceModal = useSetAtom(openCreateWorkspaceModalAtom);
|
||||
const setDisableCloudOpen = useSetAtom(openDisableCloudAlertModalAtom);
|
||||
|
||||
const setOpenSignIn = useSetAtom(authAtom);
|
||||
|
||||
const openSignInModal = useCallback(() => {
|
||||
if (!runtimeConfig.enableCloud) {
|
||||
setDisableCloudOpen(true);
|
||||
} else {
|
||||
setOpenSignIn(state => ({
|
||||
...state,
|
||||
openModal: true,
|
||||
}));
|
||||
}
|
||||
}, [setDisableCloudOpen, setOpenSignIn]);
|
||||
setOpenSignIn(state => ({
|
||||
...state,
|
||||
openModal: true,
|
||||
}));
|
||||
}, [setOpenSignIn]);
|
||||
|
||||
const onNewWorkspace = useCallback(() => {
|
||||
if (!isAuthenticated && !runtimeConfig.allowLocalWorkspace) {
|
||||
|
||||
@@ -192,17 +192,15 @@ export const RootAppSidebar = memo(
|
||||
<AppSidebarJournalButton
|
||||
docCollection={currentWorkspace.docCollection}
|
||||
/>
|
||||
{runtimeConfig.enableNewSettingModal ? (
|
||||
<MenuItem
|
||||
data-testid="slider-bar-workspace-setting-button"
|
||||
icon={<SettingsIcon />}
|
||||
onClick={onOpenSettingModal}
|
||||
>
|
||||
<span data-testid="settings-modal-trigger">
|
||||
{t['com.affine.settingSidebar.title']()}
|
||||
</span>
|
||||
</MenuItem>
|
||||
) : null}
|
||||
<MenuItem
|
||||
data-testid="slider-bar-workspace-setting-button"
|
||||
icon={<SettingsIcon />}
|
||||
onClick={onOpenSettingModal}
|
||||
>
|
||||
<span data-testid="settings-modal-trigger">
|
||||
{t['com.affine.settingSidebar.title']()}
|
||||
</span>
|
||||
</MenuItem>
|
||||
</SidebarContainer>
|
||||
<SidebarScrollableContainer>
|
||||
<FavoriteList docCollection={docCollection} />
|
||||
|
||||
@@ -11,7 +11,6 @@ import {
|
||||
} from '@affine/component';
|
||||
import {
|
||||
authAtom,
|
||||
openDisableCloudAlertModalAtom,
|
||||
openSettingModalAtom,
|
||||
openSignOutModalAtom,
|
||||
} from '@affine/core/atoms';
|
||||
@@ -65,13 +64,11 @@ const AuthorizedUserInfo = ({ account }: { account: AuthAccountInfo }) => {
|
||||
};
|
||||
|
||||
const UnauthorizedUserInfo = () => {
|
||||
const setDisableCloudOpen = useSetAtom(openDisableCloudAlertModalAtom);
|
||||
const setOpen = useSetAtom(authAtom);
|
||||
|
||||
const openSignInModal = useCallback(() => {
|
||||
if (!runtimeConfig.enableCloud) setDisableCloudOpen(true);
|
||||
else setOpen(state => ({ ...state, openModal: true }));
|
||||
}, [setDisableCloudOpen, setOpen]);
|
||||
setOpen(state => ({ ...state, openModal: true }));
|
||||
}, [setOpen]);
|
||||
|
||||
return (
|
||||
<Button
|
||||
|
||||
@@ -73,7 +73,6 @@ export const useEnableCloud = () => {
|
||||
const confirmEnableCloud = useCallback(
|
||||
(ws: Workspace, options?: ConfirmEnableCloudOptions) => {
|
||||
const { onSuccess, onFinished } = options ?? {};
|
||||
if (!runtimeConfig.enableCloud) return;
|
||||
|
||||
const closeOnSuccess = () => {
|
||||
closeConfirmModal();
|
||||
|
||||
@@ -253,7 +253,7 @@ export function useRegisterBlocksuiteEditorCommands() {
|
||||
})
|
||||
);
|
||||
|
||||
if (runtimeConfig.enablePageHistory && isCloudWorkspace) {
|
||||
if (isCloudWorkspace) {
|
||||
unsubs.push(
|
||||
registerAffineCommand({
|
||||
id: `editor:${mode}-page-history`,
|
||||
|
||||
@@ -16,7 +16,6 @@ import type { SettingAtom } from '../atoms';
|
||||
import {
|
||||
authAtom,
|
||||
openCreateWorkspaceModalAtom,
|
||||
openDisableCloudAlertModalAtom,
|
||||
openSettingModalAtom,
|
||||
openSignOutModalAtom,
|
||||
} from '../atoms';
|
||||
@@ -25,7 +24,6 @@ import { AiLoginRequiredModal } from '../components/affine/auth/ai-login-require
|
||||
import { CreateWorkspaceModal } from '../components/affine/create-workspace-modal';
|
||||
import { HistoryTipsModal } from '../components/affine/history-tips-modal';
|
||||
import { IssueFeedbackModal } from '../components/affine/issue-feedback-modal';
|
||||
import { PaymentDisableModal } from '../components/affine/payment-disable';
|
||||
import {
|
||||
CloudQuotaModal,
|
||||
LocalQuotaModal,
|
||||
@@ -33,7 +31,6 @@ import {
|
||||
import { SettingModal } from '../components/affine/setting-modal';
|
||||
import { SignOutModal } from '../components/affine/sign-out-modal';
|
||||
import { StarAFFiNEModal } from '../components/affine/star-affine-modal';
|
||||
import { TmpDisableAffineCloudModal } from '../components/affine/tmp-disable-affine-cloud-modal';
|
||||
import { MoveToTrash } from '../components/page-list';
|
||||
import { useTrashModalHelper } from '../hooks/affine/use-trash-modal-helper';
|
||||
import { useAsyncCallback } from '../hooks/affine-async-hooks';
|
||||
@@ -137,9 +134,6 @@ export const AuthModal = (): ReactElement => {
|
||||
|
||||
export function CurrentWorkspaceModals() {
|
||||
const currentWorkspace = useService(WorkspaceService).workspace;
|
||||
const [openDisableCloudAlertModal, setOpenDisableCloudAlertModal] = useAtom(
|
||||
openDisableCloudAlertModalAtom
|
||||
);
|
||||
|
||||
const { trashModal, setTrashModal, handleOnConfirm } = useTrashModalHelper(
|
||||
currentWorkspace.docCollection
|
||||
@@ -158,10 +152,6 @@ export function CurrentWorkspaceModals() {
|
||||
|
||||
return (
|
||||
<>
|
||||
<TmpDisableAffineCloudModal
|
||||
open={openDisableCloudAlertModal}
|
||||
onOpenChange={setOpenDisableCloudAlertModal}
|
||||
/>
|
||||
<StarAFFiNEModal />
|
||||
<IssueFeedbackModal />
|
||||
{currentWorkspace ? <Setting /> : null}
|
||||
@@ -256,7 +246,6 @@ export const AllWorkspaceModals = (): ReactElement => {
|
||||
/>
|
||||
<AuthModal />
|
||||
<SignOutConfirmModal />
|
||||
<PaymentDisableModal />
|
||||
</>
|
||||
);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user