diff options
| author | Weblate <noreply@weblate.org> | 2023-06-08 14:40:08 +0000 |
|---|---|---|
| committer | Weblate <noreply@weblate.org> | 2023-06-08 14:40:08 +0000 |
| commit | 89bbbf6fe4348236f9828a39ddc8f1790cb2f2f4 (patch) | |
| tree | c175788ffc6917a66db810eb14073c57b750efb3 /frontend/src/components/modals | |
| parent | fdc556edeed416843f3e4b9d5c1a9e163dc72d89 (diff) | |
| parent | 9a05c228a004392df6921a7706f4ae6a62fff2d3 (diff) | |
| download | decky-loader-89bbbf6fe4348236f9828a39ddc8f1790cb2f2f4.tar.gz decky-loader-89bbbf6fe4348236f9828a39ddc8f1790cb2f2f4.zip | |
Merge remote-tracking branch 'origin/main'
Diffstat (limited to 'frontend/src/components/modals')
| -rw-r--r-- | frontend/src/components/modals/PluginUninstallModal.tsx | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/frontend/src/components/modals/PluginUninstallModal.tsx b/frontend/src/components/modals/PluginUninstallModal.tsx new file mode 100644 index 00000000..e7ecbc99 --- /dev/null +++ b/frontend/src/components/modals/PluginUninstallModal.tsx @@ -0,0 +1,30 @@ +import { ConfirmModal } from 'decky-frontend-lib'; +import { FC } from 'react'; + +interface PluginUninstallModalProps { + name: string; + title: string; + buttonText: string; + description: string; + closeModal?(): void; +} + +const PluginUninstallModal: FC<PluginUninstallModalProps> = ({ name, title, buttonText, description, closeModal }) => { + return ( + <ConfirmModal + closeModal={closeModal} + onOK={async () => { + await window.DeckyPluginLoader.callServerMethod('uninstall_plugin', { name }); + // uninstalling a plugin resets the hidden setting for it server-side + // we invalidate here so if you re-install it, you won't have an out-of-date hidden filter + await window.DeckyPluginLoader.hiddenPluginsService.invalidate(); + }} + strTitle={title} + strOKButtonText={buttonText} + > + {description} + </ConfirmModal> + ); +}; + +export default PluginUninstallModal; |
