From 88670c679fee4ae25a2f9ee22a836e76a20062d9 Mon Sep 17 00:00:00 2001 From: Tea Date: Sat, 13 Jun 2026 17:20:03 -0400 Subject: [PATCH] 1.12.3 --- main.ts | 32 +++++++++++++++++++------------- manifest.json | 2 +- package.json | 2 +- 3 files changed, 21 insertions(+), 15 deletions(-) diff --git a/main.ts b/main.ts index 9a8699e..0a165b3 100644 --- a/main.ts +++ b/main.ts @@ -408,7 +408,7 @@ export default class MultimuseObsidian extends Plugin { /** Brief yield for the current poll loop to exit; never block posts on a full poll batch. */ private async yieldPollSlot(maxWaitMs = POLL_YIELD_MS): Promise { this.prioritizePostOverPolling(); - if (!this.pollRunPromise) { + if (this.pollRunPromise === null) { return; } await Promise.race([ @@ -695,8 +695,8 @@ export default class MultimuseObsidian extends Plugin { } const data = parseJson(response.text); return { - header: (data.header || '').trim() ? data.header! : '', - footer: (data.footer || '').trim() ? data.footer! : '', + header: (data.header ?? '').trim(), + footer: (data.footer ?? '').trim(), }; } catch (error) { console.debug('[MultimuseObsidian] resolveMuseWrappers:', error); @@ -2129,20 +2129,21 @@ export default class MultimuseObsidian extends Plugin { showSuggester(items: string[], _values: T[], title?: string): Promise { return new Promise((resolve) => { - const plugin = this; const modal = new (class extends Modal { selectedIndex: number | null = null; items: string[]; titleText: string; + host: MultimuseObsidian; - constructor(app: App, items: string[], titleText?: string) { + constructor(app: App, items: string[], titleText: string | undefined, host: MultimuseObsidian) { super(app); this.items = items; this.titleText = titleText || 'Select an option'; + this.host = host; } onOpen() { - plugin.isolateWizardModal(this); + this.host.isolateWizardModal(this); const { contentEl } = this; contentEl.empty(); this.setTitle(this.titleText); @@ -2190,7 +2191,7 @@ export default class MultimuseObsidian extends Plugin { onClose() { resolve(this.selectedIndex); } - })(this.app, items, title); + })(this.app, items, title, this); modal.open(); }); @@ -2198,14 +2199,19 @@ export default class MultimuseObsidian extends Plugin { showInputPrompt(prompt: string, defaultValue?: string): Promise { return new Promise((resolve) => { - const plugin = this; const modal = new (class extends Modal { inputEl!: HTMLInputElement; value: string | null = null; cancelled = false; + host: MultimuseObsidian; + promptText: string; + defaultText: string; - constructor(app: App) { + constructor(app: App, host: MultimuseObsidian, promptText: string, defaultText?: string) { super(app); + this.host = host; + this.promptText = promptText; + this.defaultText = defaultText || ''; } confirm(): void { @@ -2215,8 +2221,8 @@ export default class MultimuseObsidian extends Plugin { } onOpen() { - plugin.isolateWizardModal(this, () => this.confirm()); - this.setTitle(prompt); + this.host.isolateWizardModal(this, () => this.confirm()); + this.setTitle(this.promptText); const { contentEl } = this; contentEl.empty(); @@ -2224,7 +2230,7 @@ export default class MultimuseObsidian extends Plugin { type: 'text', cls: 'multimuse-input', }); - this.inputEl.value = defaultValue || ''; + this.inputEl.value = this.defaultText; new Setting(contentEl) .addButton((btn) => btn @@ -2247,7 +2253,7 @@ export default class MultimuseObsidian extends Plugin { onClose() { resolve(this.cancelled ? null : this.value); } - })(this.app); + })(this.app, this, prompt, defaultValue); modal.open(); }); diff --git a/manifest.json b/manifest.json index 395e383..9b47d3c 100644 --- a/manifest.json +++ b/manifest.json @@ -1,7 +1,7 @@ { "id": "multimuse-tracker", "name": "Multimuse Tracker", - "version": "1.12.2", + "version": "1.12.3", "minAppVersion": "1.4.0", "description": "Roleplay sync tool for use with the MultiMuse bot in discord.", "author": "BackstagePass Group", diff --git a/package.json b/package.json index 8bbbc7b..27db044 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "multimuse-tracker", - "version": "1.12.2", + "version": "1.12.3", "description": "MultiMuse bot integration for tracking Discord threads and sending messages as muses", "main": "main.js", "scripts": {