fix: should not show open folder if it is not moved (#2299)

This commit is contained in:
Peng Xiao
2023-05-11 13:36:22 +08:00
committed by LongYinan
parent 9902892615
commit 20fb801ecd
12 changed files with 170 additions and 51 deletions

View File

@@ -260,6 +260,7 @@
"Move folder hint": "Select a new storage location.",
"Storage Folder": "Storage Folder",
"DB_FILE_INVALID": "Invalid Database file",
"FILE_ALREADY_EXISTS": "File already exists",
"Name Your Workspace": "Name Your Workspace",
"DB_FILE_PATH_INVALID": "Database file path invalid",
"Default db location hint": "By default will be saved to {{location}}",

View File

@@ -36,7 +36,7 @@ vi.stubGlobal('window', {
},
events: {
db: {
onDbFileUpdate: (fn: (id: string) => void) => {
onDBFileUpdate: (fn: (id: string) => void) => {
triggerDBUpdate = fn;
return () => {
triggerDBUpdate = null;
@@ -44,7 +44,10 @@ vi.stubGlobal('window', {
},
// not used in this test
onDbFileMissing: () => {
onDBFileMissing: () => {
return () => {};
},
onDBFilePathChange: () => {
return () => {};
},
},

View File

@@ -243,7 +243,7 @@ const createSQLiteProvider = (
blockSuiteWorkspace.doc.on('update', handleUpdate);
let timer = 0;
unsubscribe = events.db.onDbFileUpdate(workspaceId => {
unsubscribe = events.db.onDBFileUpdate(workspaceId => {
if (workspaceId === blockSuiteWorkspace.id) {
// throttle
logger.debug('on db update', workspaceId);