Add connection warning style logic and settings UI dropdown

This commit is contained in:
A-wry
2026-02-20 21:51:30 -05:00
parent b1bba7685e
commit f4d8c0a8db
2 changed files with 16 additions and 1 deletions

View File

@@ -4,6 +4,7 @@ import { LiveSyncSetting as Setting } from "./LiveSyncSetting.ts";
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";
export function paneGeneral(
this: ObsidianLiveSyncSettingTab,
paneEl: HTMLElement,
@@ -24,6 +25,16 @@ export function paneGeneral(
});
new Setting(paneEl).autoWireToggle("showStatusOnStatusbar");
new Setting(paneEl).autoWireToggle("hideFileWarningNotice");
new Setting(paneEl).autoWireDropDown("connectionWarningStyle", {
options: {
banner: "Show full banner",
icon: "Show icon only",
hidden: "Hide completely",
},
});
this.addOnSaved("connectionWarningStyle", () => {
eventHub.emitEvent(EVENT_ON_UNRESOLVED_ERROR);
});
});
void addPanel(paneEl, $msg("obsidianLiveSyncSettingTab.titleLogging")).then((paneEl) => {
paneEl.addClass("wizardHidden");