refactor: align platform APIs with community review

This commit is contained in:
vorotamoroz committed 2026-07-17 14:47:27 +00:00
1 parent 298738fc67
commit 326bf77183
39 files changed
+444 -294

No files matched your search

+2 -6
View File
@@ -4,20 +4,16 @@ import { EVENT_PLUGIN_UNLOADED, eventHub } from "@/common/events.ts";
import { compatGlobal, type CompatIntervalHandle } from "@vrtmrz/livesync-commonlib/compat/common/coreEnvFunctions";
class AutoClosableModal extends Modal {
_closeByUnload() {
// eslint-disable-next-line @typescript-eslint/unbound-method
_closeByUnload = () => {
eventHub.off(EVENT_PLUGIN_UNLOADED, this._closeByUnload);
this.close();
}
};
constructor(app: App) {
super(app);
this._closeByUnload = this._closeByUnload.bind(this);
// eslint-disable-next-line @typescript-eslint/unbound-method
eventHub.once(EVENT_PLUGIN_UNLOADED, this._closeByUnload);
}
override onClose() {
// eslint-disable-next-line @typescript-eslint/unbound-method
eventHub.off(EVENT_PLUGIN_UNLOADED, this._closeByUnload);
}
}