mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-07-19 11:06:25 +08:00
1.adjust code style.
This commit is contained in:
@@ -2,8 +2,6 @@ import { useFlag } from '@toeverything/datasource/feature-flags';
|
||||
|
||||
export const useSettingFlags = () => {
|
||||
const booleanFullWidthChecked = useFlag('BooleanFullWidthChecked', 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);
|
||||
@@ -11,8 +9,6 @@ export const useSettingFlags = () => {
|
||||
|
||||
return {
|
||||
booleanFullWidthChecked,
|
||||
booleanExportWorkspace,
|
||||
booleanImportWorkspace,
|
||||
booleanExportHtml,
|
||||
booleanExportPdf,
|
||||
booleanExportMarkdown,
|
||||
|
||||
@@ -156,15 +156,13 @@ export const useSettings = (): SettingItem[] => {
|
||||
type: 'button',
|
||||
name: t('Import Workspace'),
|
||||
key: 'Import Workspace',
|
||||
onClick: () => importWorkspace(workspaceId),
|
||||
flag: 'booleanClearWorkspace',
|
||||
onClick: () => importWorkspace(),
|
||||
},
|
||||
{
|
||||
type: 'button',
|
||||
name: t('Export Workspace'),
|
||||
key: 'Export Workspace',
|
||||
onClick: () => exportWorkspace(),
|
||||
flag: 'booleanExportWorkspace',
|
||||
},
|
||||
];
|
||||
|
||||
|
||||
@@ -1,18 +1,17 @@
|
||||
/**
|
||||
* @deprecated debugging method, deprecated
|
||||
*/
|
||||
export const importWorkspace = (workspaceId: string) => {
|
||||
//@ts-ignore
|
||||
window.client
|
||||
.inspector()
|
||||
.load()
|
||||
.then(status => {
|
||||
if (status) {
|
||||
if (window.confirm('Your currently open data will be lost.')) {
|
||||
window.location.href = `/${workspaceId}/`;
|
||||
}
|
||||
}
|
||||
});
|
||||
export const importWorkspace = async () => {
|
||||
if (window.confirm('Your currently open data will be lost.')) {
|
||||
//@ts-ignore
|
||||
const status = await window.client.inspector().load();
|
||||
|
||||
console.log(status);
|
||||
|
||||
if (status) {
|
||||
window.location.reload();
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user