Tagged downstream network errors to respect networkWarningStyle setting

This commit is contained in:
A-wry
2026-02-23 22:10:25 -05:00
parent f4d8c0a8db
commit fdcf3be0f9
5 changed files with 35 additions and 19 deletions

View File

@@ -5,6 +5,7 @@ import type { ObsidianLiveSyncSettingTab } from "./ObsidianLiveSyncSettingTab.ts
import type { PageFunctions } from "./SettingPane.ts";
import { visibleOnly } from "./SettingPane.ts";
import { EVENT_ON_UNRESOLVED_ERROR, eventHub } from "@/common/events.ts";
import { NetworkWarningStyles } from "@lib/common/models/setting.const.ts";
export function paneGeneral(
this: ObsidianLiveSyncSettingTab,
paneEl: HTMLElement,
@@ -25,14 +26,14 @@ export function paneGeneral(
});
new Setting(paneEl).autoWireToggle("showStatusOnStatusbar");
new Setting(paneEl).autoWireToggle("hideFileWarningNotice");
new Setting(paneEl).autoWireDropDown("connectionWarningStyle", {
new Setting(paneEl).autoWireDropDown("networkWarningStyle", {
options: {
banner: "Show full banner",
icon: "Show icon only",
hidden: "Hide completely",
[NetworkWarningStyles.BANNER]: "Show full banner",
[NetworkWarningStyles.ICON]: "Show icon only",
[NetworkWarningStyles.HIDDEN]: "Hide completely",
},
});
this.addOnSaved("connectionWarningStyle", () => {
this.addOnSaved("networkWarningStyle", () => {
eventHub.emitEvent(EVENT_ON_UNRESOLVED_ERROR);
});
});