mirror of
https://github.com/toeverything/AFFiNE.git
synced 2024-11-23 05:33:08 +03:00
fix: duplicate enable cloud confirm modal after enable (#1552)
This commit is contained in:
parent
e5173d04ab
commit
d4006f0693
@ -17,7 +17,6 @@ import {
|
|||||||
LocalWorkspace,
|
LocalWorkspace,
|
||||||
RemWorkspaceFlavour,
|
RemWorkspaceFlavour,
|
||||||
} from '../../../../../shared';
|
} from '../../../../../shared';
|
||||||
import { apis } from '../../../../../shared/apis';
|
|
||||||
import { Unreachable } from '../../../affine-error-eoundary';
|
import { Unreachable } from '../../../affine-error-eoundary';
|
||||||
import { EnableAffineCloudModal } from '../../../enable-affine-cloud-modal';
|
import { EnableAffineCloudModal } from '../../../enable-affine-cloud-modal';
|
||||||
import { WorkspaceSettingDetailProps } from '../../index';
|
import { WorkspaceSettingDetailProps } from '../../index';
|
||||||
@ -49,8 +48,6 @@ const PublishPanelAffine: React.FC<PublishPanelAffineProps> = ({
|
|||||||
toast(t('Copied link to clipboard'));
|
toast(t('Copied link to clipboard'));
|
||||||
}, [shareUrl, t]);
|
}, [shareUrl, t]);
|
||||||
|
|
||||||
const [open, setOpen] = useState(false);
|
|
||||||
|
|
||||||
if (workspace.public) {
|
if (workspace.public) {
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
@ -89,27 +86,13 @@ const PublishPanelAffine: React.FC<PublishPanelAffineProps> = ({
|
|||||||
<Wrapper marginBottom="42px">{t('Publishing Description')}</Wrapper>
|
<Wrapper marginBottom="42px">{t('Publishing Description')}</Wrapper>
|
||||||
<Button
|
<Button
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
setOpen(true);
|
publishWorkspace(true);
|
||||||
}}
|
}}
|
||||||
type="light"
|
type="light"
|
||||||
shape="circle"
|
shape="circle"
|
||||||
>
|
>
|
||||||
{t('Publish to web')}
|
{t('Publish to web')}
|
||||||
</Button>
|
</Button>
|
||||||
<EnableAffineCloudModal
|
|
||||||
open={open}
|
|
||||||
onClose={() => {
|
|
||||||
setOpen(false);
|
|
||||||
}}
|
|
||||||
onConfirm={() => {
|
|
||||||
if (!apis.auth.isLogin) {
|
|
||||||
toast(t('Please login first'));
|
|
||||||
} else {
|
|
||||||
publishWorkspace(true);
|
|
||||||
setOpen(false);
|
|
||||||
}
|
|
||||||
}}
|
|
||||||
/>
|
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user