diff --git a/src/components/PluginSettings/PluginModal.tsx b/src/components/PluginSettings/PluginModal.tsx index 0771a82a..89c8f5fa 100644 --- a/src/components/PluginSettings/PluginModal.tsx +++ b/src/components/PluginSettings/PluginModal.tsx @@ -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(); } diff --git a/src/utils/types.ts b/src/utils/types.ts index e5486e9a..da9d3999 100644 --- a/src/utils/types.ts +++ b/src/utils/types.ts @@ -117,6 +117,11 @@ export interface PluginDef { * If a string is returned, show the error to the user. */ beforeSave?(options: Record): Promisable; + /** + * 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