Fixed: Now error messages are kept hidden if the show status inside the editor is disabled.

This commit is contained in:
vorotamoroz committed 2026-04-05 17:43:29 +09:00
1 parent d709bcc1d0
commit bc22d61a3a
3 files changed
+19 -3

No files matched your search

+1 -1
Submodule src/lib updated: d802c84a34...37b8e2813e.
+15 -2
View File
@@ -277,7 +277,17 @@ export class ModuleLog extends AbstractObsidianModule {
} }
async updateMessageArea() { async updateMessageArea() {
if (this.messageArea) { if (!this.messageArea) return;
const showStatusOnEditor = this.settings?.showStatusOnEditor ?? false;
if (this.statusDiv) {
this.statusDiv.style.display = showStatusOnEditor ? "" : "none";
}
if (!showStatusOnEditor) {
this.messageArea.innerText = "";
return;
}
const messageLines = []; const messageLines = [];
const fileStatus = this.activeFileStatus.value; const fileStatus = this.activeFileStatus.value;
if (fileStatus && !this.settings.hideFileWarningNotice) messageLines.push(fileStatus); if (fileStatus && !this.settings.hideFileWarningNotice) messageLines.push(fileStatus);
@@ -298,7 +308,6 @@ export class ModuleLog extends AbstractObsidianModule {
} }
this.messageArea.innerText = messageLines.map((e) => `⚠️ ${e}`).join("\n"); this.messageArea.innerText = messageLines.map((e) => `⚠️ ${e}`).join("\n");
} }
}
onActiveLeafChange() { onActiveLeafChange() {
fireAndForget(async () => { fireAndForget(async () => {
@@ -326,6 +335,9 @@ export class ModuleLog extends AbstractObsidianModule {
} }
this.statusBar?.setText(newMsg.split("\n")[0]); this.statusBar?.setText(newMsg.split("\n")[0]);
if (this.statusDiv) {
this.statusDiv.style.display = this.settings?.showStatusOnEditor ? "" : "none";
}
if (this.settings?.showStatusOnEditor && this.statusDiv) { if (this.settings?.showStatusOnEditor && this.statusDiv) {
if (this.settings.showLongerLogInsideEditor) { if (this.settings.showLongerLogInsideEditor) {
const now = new Date().getTime(); const now = new Date().getTime();
@@ -402,6 +414,7 @@ export class ModuleLog extends AbstractObsidianModule {
this.messageArea = this.statusDiv.createDiv({ cls: "livesync-status-messagearea" }); this.messageArea = this.statusDiv.createDiv({ cls: "livesync-status-messagearea" });
this.logMessage = this.statusDiv.createDiv({ cls: "livesync-status-logmessage" }); this.logMessage = this.statusDiv.createDiv({ cls: "livesync-status-logmessage" });
this.logHistory = this.statusDiv.createDiv({ cls: "livesync-status-loghistory" }); this.logHistory = this.statusDiv.createDiv({ cls: "livesync-status-loghistory" });
this.statusDiv.style.display = this.settings?.showStatusOnEditor ? "" : "none";
eventHub.onEvent(EVENT_LAYOUT_READY, () => this.adjustStatusDivPosition()); eventHub.onEvent(EVENT_LAYOUT_READY, () => this.adjustStatusDivPosition());
if (this.settings?.showStatusOnStatusbar) { if (this.settings?.showStatusOnStatusbar) {
this.statusBar = this.services.API.addStatusBarItem(); this.statusBar = this.services.API.addStatusBarItem();
@@ -21,6 +21,9 @@ export function paneGeneral(
}); });
this.addOnSaved("displayLanguage", () => this.display()); this.addOnSaved("displayLanguage", () => this.display());
new Setting(paneEl).autoWireToggle("showStatusOnEditor"); new Setting(paneEl).autoWireToggle("showStatusOnEditor");
this.addOnSaved("showStatusOnEditor", () => {
eventHub.emitEvent(EVENT_ON_UNRESOLVED_ERROR);
});
new Setting(paneEl).autoWireToggle("showOnlyIconsOnEditor", { new Setting(paneEl).autoWireToggle("showOnlyIconsOnEditor", {
onUpdate: visibleOnly(() => this.isConfiguredAs("showStatusOnEditor", true)), onUpdate: visibleOnly(() => this.isConfiguredAs("showStatusOnEditor", true)),
}); });