mirror of
https://github.com/Equicord/Equicord.git
synced 2025-02-25 01:28:52 -05:00
afterSave & Fix CustomSounds
This commit is contained in:
parent
cc6db0b72b
commit
7c95d3a729
2 changed files with 7 additions and 0 deletions
|
@ -126,6 +126,7 @@ export default function PluginModal({ plugin, onRestartNeeded, onClose, transiti
|
|||
}
|
||||
|
||||
let restartNeeded = false;
|
||||
if (plugin.name === "CustomSounds") restartNeeded = true;
|
||||
for (const [key, value] of Object.entries(tempSettings)) {
|
||||
const option = plugin.options[key];
|
||||
pluginSettings[key] = value;
|
||||
|
@ -133,6 +134,7 @@ export default function PluginModal({ plugin, onRestartNeeded, onClose, transiti
|
|||
if (option?.restartNeeded) restartNeeded = true;
|
||||
}
|
||||
if (restartNeeded) onRestartNeeded();
|
||||
plugin.afterSave = true;
|
||||
onClose();
|
||||
}
|
||||
|
||||
|
|
|
@ -117,6 +117,11 @@ export interface PluginDef {
|
|||
* If a string is returned, show the error to the user.
|
||||
*/
|
||||
beforeSave?(options: Record<string, any>): Promisable<true | string>;
|
||||
/**
|
||||
* Check that this returns true after allowing a save to complete.
|
||||
* If a string is returned, show the error to the user.
|
||||
*/
|
||||
afterSave?: boolean;
|
||||
/**
|
||||
* Allows you to specify a custom Component that will be rendered in your
|
||||
* plugin's settings page
|
||||
|
|
Loading…
Add table
Reference in a new issue