mirror of
https://github.com/BetterSEQTA/BetterSEQTA-Plus.git
synced 2026-08-28 17:21:05 +00:00
d10fca6c0f
Batch settings storage writes, tier plugin startup, lazy-load heavy UI chunks, and optimize global search indexing. Stop tweening bar height in grade analytics to prevent invalid negative SVG rect values. Co-authored-by: Cursor <cursoragent@cursor.com>
34 lines
892 B
TypeScript
34 lines
892 B
TypeScript
type SettingsPopupCallback = () => void;
|
|
|
|
/**
|
|
* Singleton that notifies listeners when the in-page settings popup closes.
|
|
* Used by the colour picker and other overlays tied to ExtensionPopup.
|
|
*/
|
|
class SettingsPopup {
|
|
private static instance: SettingsPopup;
|
|
private listeners: Set<SettingsPopupCallback> = new Set();
|
|
|
|
private constructor() {}
|
|
|
|
public static getInstance(): SettingsPopup {
|
|
if (!SettingsPopup.instance) {
|
|
SettingsPopup.instance = new SettingsPopup();
|
|
}
|
|
return SettingsPopup.instance;
|
|
}
|
|
|
|
public addListener(callback: SettingsPopupCallback): void {
|
|
this.listeners.add(callback);
|
|
}
|
|
|
|
public removeListener(callback: SettingsPopupCallback): void {
|
|
this.listeners.delete(callback);
|
|
}
|
|
|
|
public triggerClose(): void {
|
|
this.listeners.forEach((callback) => callback());
|
|
}
|
|
}
|
|
|
|
export const settingsPopup = SettingsPopup.getInstance();
|