mirror of
https://github.com/Vendicated/Vencord
synced 2024-09-13 04:29:24 -04:00
Merge branch 'dev' into portVolumeBooster
This commit is contained in:
commit
b3838b2b51
2 changed files with 6 additions and 0 deletions
|
@ -230,6 +230,10 @@ export function definePluginSettings<
|
|||
if (!definedSettings.pluginName) throw new Error("Cannot access settings before plugin is initialized");
|
||||
return Settings.plugins[definedSettings.pluginName] as any;
|
||||
},
|
||||
get plain() {
|
||||
if (!definedSettings.pluginName) throw new Error("Cannot access settings before plugin is initialized");
|
||||
return PlainSettings.plugins[definedSettings.pluginName] as any;
|
||||
},
|
||||
use: settings => useSettings(
|
||||
settings?.map(name => `plugins.${definedSettings.pluginName}.${name}`) as UseSettings<Settings>[]
|
||||
).plugins[definedSettings.pluginName] as any,
|
||||
|
|
|
@ -309,6 +309,8 @@ export interface DefinedSettings<
|
|||
> {
|
||||
/** Shorthand for `Vencord.Settings.plugins.PluginName`, but with typings */
|
||||
store: SettingsStore<Def> & PrivateSettings;
|
||||
/** Shorthand for `Vencord.PlainSettings.plugins.PluginName`, but with typings */
|
||||
plain: SettingsStore<Def> & PrivateSettings;
|
||||
/**
|
||||
* React hook for getting the settings for this plugin
|
||||
* @param filter optional filter to avoid rerenders for irrelevent settings
|
||||
|
|
Loading…
Reference in a new issue