fix: export then add test case (#7024)

This commit is contained in:
pengx17
2024-05-24 04:49:07 +00:00
parent 7c2f60c441
commit 5e1528b50b
4 changed files with 20 additions and 41 deletions

View File

@@ -92,8 +92,10 @@ export async function saveDBFileAs(
): Promise<SaveDBFileResult> {
try {
const db = await ensureSQLiteDB(workspaceId);
const fakedResult = getFakedResult();
const ret =
getFakedResult() ??
fakedResult ??
(await mainRPC.showSaveDialog({
properties: ['showOverwriteConfirmation'],
title: 'Save Workspace',
@@ -120,9 +122,11 @@ export async function saveDBFileAs(
await fs.copyFile(db.path, filePath);
logger.log('saved', filePath);
mainRPC.showItemInFolder(filePath).catch(err => {
console.error(err);
});
if (!fakedResult) {
mainRPC.showItemInFolder(filePath).catch(err => {
console.error(err);
});
}
return { filePath };
} catch (err) {
logger.error('saveDBFileAs', err);