mirror of
https://github.com/vrtmrz/obsidian-livesync.git
synced 2025-12-24 07:01:29 +00:00
Fixed:
- Fixed the issue about lock/unlock remote database while rebuilding in wizard
This commit is contained in:
@@ -635,6 +635,7 @@ export class ObsidianLiveSyncSettingTab extends PluginSettingTab {
|
|||||||
await this.plugin.markRemoteLocked();
|
await this.plugin.markRemoteLocked();
|
||||||
})
|
})
|
||||||
);
|
);
|
||||||
|
let rebuildRemote = false;
|
||||||
|
|
||||||
new Setting(containerRemoteDatabaseEl)
|
new Setting(containerRemoteDatabaseEl)
|
||||||
.setName("")
|
.setName("")
|
||||||
@@ -653,7 +654,7 @@ export class ObsidianLiveSyncSettingTab extends PluginSettingTab {
|
|||||||
} else {
|
} else {
|
||||||
this.plugin.settings.customChunkSize = 100;
|
this.plugin.settings.customChunkSize = 100;
|
||||||
}
|
}
|
||||||
|
rebuildRemote = false;
|
||||||
changeDisplay("10")
|
changeDisplay("10")
|
||||||
})
|
})
|
||||||
);
|
);
|
||||||
@@ -674,8 +675,7 @@ export class ObsidianLiveSyncSettingTab extends PluginSettingTab {
|
|||||||
} else {
|
} else {
|
||||||
this.plugin.settings.customChunkSize = 100;
|
this.plugin.settings.customChunkSize = 100;
|
||||||
}
|
}
|
||||||
this.plugin.saveSettings();
|
rebuildRemote = true;
|
||||||
await this.plugin.tryResetRemoteDatabase();
|
|
||||||
changeDisplay("10")
|
changeDisplay("10")
|
||||||
})
|
})
|
||||||
);
|
);
|
||||||
@@ -1200,8 +1200,15 @@ export class ObsidianLiveSyncSettingTab extends PluginSettingTab {
|
|||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
this.plugin.app.setting.close()
|
this.plugin.app.setting.close()
|
||||||
await this.plugin.resetLocalDatabase();
|
await this.plugin.resetLocalDatabase();
|
||||||
await this.plugin.initializeDatabase(true)
|
await this.plugin.initializeDatabase(true);
|
||||||
|
if (rebuildRemote) {
|
||||||
|
await this.plugin.markRemoteLocked();
|
||||||
|
await this.plugin.tryResetRemoteDatabase();
|
||||||
|
await this.plugin.markRemoteLocked();
|
||||||
|
await this.plugin.markRemoteResolved();
|
||||||
|
}
|
||||||
await this.plugin.replicate(true);
|
await this.plugin.replicate(true);
|
||||||
|
|
||||||
Logger("All done! Please set up subsequent devices with 'Copy setup URI' and 'Open setup URI'.", LOG_LEVEL.NOTICE);
|
Logger("All done! Please set up subsequent devices with 'Copy setup URI' and 'Open setup URI'.", LOG_LEVEL.NOTICE);
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
this.plugin.app.commands.executeCommandById("obsidian-livesync:livesync-copysetupuri")
|
this.plugin.app.commands.executeCommandById("obsidian-livesync:livesync-copysetupuri")
|
||||||
|
|||||||
Reference in New Issue
Block a user