feat: implement force enable/disable functionality for plugins and themes
This commit is contained in:
@@ -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);
|
||||
},
|
||||
}));
|
||||
|
||||
Reference in New Issue
Block a user