feat: debounce creator + general improvements

This commit is contained in:
SethBurkart123
2025-03-28 00:14:29 +11:00
parent 5413286f56
commit ad2ad4d456
5 changed files with 22 additions and 5 deletions
@@ -1,6 +1,7 @@
import localforage from 'localforage';
import type { CustomTheme, LoadedCustomTheme } from '@/types/CustomThemes';
import { settingsState } from '@/seqta/utils/listeners/SettingsState';
import debounce from '@/seqta/utils/debounce';
type ThemeContent = {
id: string;
@@ -517,6 +518,14 @@ export class ThemeManager {
}
}
/**
* Update the preview of a theme (debounced)
* @param theme - The theme to update the preview of
*/
public updatePreviewDebounced = debounce((theme: Partial<LoadedCustomTheme>): void => {
this.updatePreview(theme);
}, 2);
/**
* Clear theme preview
*/