mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-07-23 13:29:02 +08:00
1.adjust export/import database;
This commit is contained in:
@@ -2,8 +2,8 @@ import { useFlag } from '@toeverything/datasource/feature-flags';
|
||||
|
||||
export const useSettingFlags = () => {
|
||||
const booleanFullWidthChecked = useFlag('BooleanFullWidthChecked', false);
|
||||
const booleanExportWorkspace = useFlag('BooleanExportWorkspace', false);
|
||||
const booleanImportWorkspace = useFlag('BooleanImportWorkspace', false);
|
||||
const booleanExportWorkspace = useFlag('BooleanExportAffineDb', true);
|
||||
const booleanImportWorkspace = useFlag('BooleanImportAffineDb', true);
|
||||
const booleanExportHtml = useFlag('BooleanExportHtml', false);
|
||||
const booleanExportPdf = useFlag('BooleanExportPdf', false);
|
||||
const booleanExportMarkdown = useFlag('BooleanExportMarkdown', false);
|
||||
|
||||
@@ -145,12 +145,19 @@ export const useSettings = (): SettingItem[] => {
|
||||
type: 'separator',
|
||||
key: 'separator2',
|
||||
},
|
||||
{
|
||||
type: 'button',
|
||||
name: t('Clear Workspace'),
|
||||
key: 'Clear Workspace',
|
||||
onClick: () => clearWorkspace(workspaceId),
|
||||
flag: 'booleanClearWorkspace',
|
||||
},
|
||||
{
|
||||
type: 'button',
|
||||
name: t('Import Workspace'),
|
||||
key: 'Import Workspace',
|
||||
onClick: () => importWorkspace(workspaceId),
|
||||
flag: 'booleanImportWorkspace',
|
||||
flag: 'booleanClearWorkspace',
|
||||
},
|
||||
{
|
||||
type: 'button',
|
||||
@@ -159,13 +166,6 @@ export const useSettings = (): SettingItem[] => {
|
||||
onClick: () => exportWorkspace(),
|
||||
flag: 'booleanExportWorkspace',
|
||||
},
|
||||
{
|
||||
type: 'button',
|
||||
name: t('Clear Workspace'),
|
||||
key: 'Clear Workspace',
|
||||
onClick: () => clearWorkspace(workspaceId),
|
||||
flag: 'booleanClearWorkspace',
|
||||
},
|
||||
];
|
||||
|
||||
return filterSettings(settings, settingFlags);
|
||||
|
||||
@@ -6,8 +6,12 @@ export const importWorkspace = (workspaceId: string) => {
|
||||
window.client
|
||||
.inspector()
|
||||
.load()
|
||||
.then(() => {
|
||||
window.location.href = `/${workspaceId}/`;
|
||||
.then(status => {
|
||||
if (status) {
|
||||
if (window.confirm('Your currently open data will be lost.')) {
|
||||
window.location.href = `/${workspaceId}/`;
|
||||
}
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user