### Fixed

- CORS Checking messages now use replacements.
- Configuring CORS setting via the UI now respects the existing rules.
- Now startup-checking works correctly again, performs migration check serially and then it will also fix starting LiveSync or start-up sync. (#696)
- Statusline in editor now supported 'Bases'.
This commit is contained in:
vorotamoroz
2025-08-20 10:36:22 +01:00
parent ed88761eaa
commit de8fd43c8b
4 changed files with 30 additions and 13 deletions

Submodule src/lib updated: a1c644e959...172e7ec61d

View File

@@ -104,7 +104,7 @@ export class ModuleMigration extends AbstractModule implements ICoreModule {
return false; return false;
} }
async checkIncompleteDocs(force: boolean = false): Promise<boolean> { async hasIncompleteDocs(force: boolean = false): Promise<boolean> {
const incompleteDocsChecked = (await this.core.kvDB.get<boolean>("checkIncompleteDocs")) || false; const incompleteDocsChecked = (await this.core.kvDB.get<boolean>("checkIncompleteDocs")) || false;
if (incompleteDocsChecked && !force) { if (incompleteDocsChecked && !force) {
this._log("Incomplete docs check already done, skipping.", LOG_LEVEL_VERBOSE); this._log("Incomplete docs check already done, skipping.", LOG_LEVEL_VERBOSE);
@@ -219,7 +219,7 @@ export class ModuleMigration extends AbstractModule implements ICoreModule {
return Promise.resolve(true); return Promise.resolve(true);
} }
async checkCompromisedChunks(): Promise<boolean> { async hasCompromisedChunks(): Promise<boolean> {
Logger(`Checking for compromised chunks...`, LOG_LEVEL_VERBOSE); Logger(`Checking for compromised chunks...`, LOG_LEVEL_VERBOSE);
if (!this.settings.encrypt) { if (!this.settings.encrypt) {
// If not encrypted, we do not need to check for compromised chunks. // If not encrypted, we do not need to check for compromised chunks.
@@ -281,13 +281,13 @@ export class ModuleMigration extends AbstractModule implements ICoreModule {
return false; return false;
} }
if (this.settings.isConfigured) { if (this.settings.isConfigured) {
if (await this.checkCompromisedChunks()) { if (!(await this.hasCompromisedChunks())) {
return false; return false;
} }
if (await this.checkIncompleteDocs()) { if (!(await this.hasIncompleteDocs())) {
return false; return false;
} }
if (await this.migrateUsingDoctor(false)) { if (!(await this.migrateUsingDoctor(false))) {
return false; return false;
} }
// await this.migrationCheck(); // await this.migrationCheck();
@@ -299,7 +299,7 @@ export class ModuleMigration extends AbstractModule implements ICoreModule {
this._log($msg("moduleMigration.logSetupCancelled"), LOG_LEVEL_NOTICE); this._log($msg("moduleMigration.logSetupCancelled"), LOG_LEVEL_NOTICE);
return false; return false;
} }
if (await this.migrateUsingDoctor(true)) { if (!(await this.migrateUsingDoctor(true))) {
return false; return false;
} }
} }
@@ -310,7 +310,7 @@ export class ModuleMigration extends AbstractModule implements ICoreModule {
await this.migrateUsingDoctor(false, reason, true); await this.migrateUsingDoctor(false, reason, true);
}); });
eventHub.onEvent(EVENT_REQUEST_RUN_FIX_INCOMPLETE, async () => { eventHub.onEvent(EVENT_REQUEST_RUN_FIX_INCOMPLETE, async () => {
await this.checkIncompleteDocs(true); await this.hasIncompleteDocs(true);
}); });
return Promise.resolve(true); return Promise.resolve(true);
} }

View File

@@ -199,12 +199,16 @@ export function paneRemoteConfig(
) { ) {
addResult($msg("obsidianLiveSyncSettingTab.okCorsOrigins")); addResult($msg("obsidianLiveSyncSettingTab.okCorsOrigins"));
} else { } else {
const fixedValue = [
...new Set([
...ConfiguredOrigins.map((e) => e.trim()),
"app://obsidian.md",
"capacitor://localhost",
"http://localhost",
]),
].join(",");
addResult($msg("obsidianLiveSyncSettingTab.errCorsOrigins")); addResult($msg("obsidianLiveSyncSettingTab.errCorsOrigins"));
addConfigFixButton( addConfigFixButton($msg("obsidianLiveSyncSettingTab.msgSetCorsOrigins"), "cors/origins", fixedValue);
$msg("obsidianLiveSyncSettingTab.msgSetCorsOrigins"),
"cors/origins",
"app://obsidian.md,capacitor://localhost,http://localhost"
);
isSuccessful = false; isSuccessful = false;
} }
addResult($msg("obsidianLiveSyncSettingTab.msgConnectionCheck"), ["ob-btn-config-head"]); addResult($msg("obsidianLiveSyncSettingTab.msgConnectionCheck"), ["ob-btn-config-head"]);

View File

@@ -385,6 +385,18 @@ span.ls-mark-cr::after {
font-size: 80%; font-size: 80%;
} }
div.workspace-leaf-content[data-type=bases] .livesync-status {
top: calc(var(--bases-header-height) + var(--header-height));
padding: 5px;
padding-right:18px;
}
.is-mobile div.workspace-leaf-content[data-type=bases] .livesync-status {
top: calc(var(--bases-header-height) + var(--view-header-height));
padding: 6px;
padding-right:18px;
}
.livesync-status div { .livesync-status div {
opacity: 0.6; opacity: 0.6;
-webkit-filter: grayscale(100%); -webkit-filter: grayscale(100%);
@@ -405,6 +417,7 @@ span.ls-mark-cr::after {
filter: unset; filter: unset;
} }
.menu-setting-poweruser-disabled .sls-setting-poweruser { .menu-setting-poweruser-disabled .sls-setting-poweruser {
display: none; display: none;
} }