feat: implement force enable/disable functionality for plugins and themes

This commit is contained in:
Linus Rath
2026-03-26 18:59:30 +01:00
parent 7a191cf78b
commit 37bc88dbad
9 changed files with 301 additions and 21 deletions
+10
View File
@@ -13,6 +13,8 @@ interface PolicyState {
getEffectiveDefault: (key: string) => unknown;
getThemePolicy: () => ThemePolicy;
isThemeDisabled: (themeId: string, isBuiltIn: boolean) => boolean;
isPluginForceEnabled: (pluginId: string) => boolean;
isThemeForceEnabled: (themeId: string) => boolean;
}
export const usePolicyStore = create<PolicyState>()((set, get) => ({
@@ -66,4 +68,12 @@ export const usePolicyStore = create<PolicyState>()((set, get) => ({
}
return (tp.disabledThemes || []).includes(themeId);
},
isPluginForceEnabled: (pluginId) => {
return (get().policy.forceEnabledPlugins || []).includes(pluginId);
},
isThemeForceEnabled: (themeId) => {
return (get().policy.forceEnabledThemes || []).includes(themeId);
},
}));