From a45df8566ed207d126e5992bb7c870acd09a1864 Mon Sep 17 00:00:00 2001
From: AAGaming <aagaming@riseup.net>
Date: Thu, 4 Jul 2024 01:27:13 -0400
Subject: fix plugin uninstalls

---
 frontend/src/components/modals/PluginUninstallModal.tsx | 13 ++++++++++---
 1 file changed, 10 insertions(+), 3 deletions(-)

(limited to 'frontend/src/components/modals/PluginUninstallModal.tsx')

diff --git a/frontend/src/components/modals/PluginUninstallModal.tsx b/frontend/src/components/modals/PluginUninstallModal.tsx
index f943ad9c..a0d04102 100644
--- a/frontend/src/components/modals/PluginUninstallModal.tsx
+++ b/frontend/src/components/modals/PluginUninstallModal.tsx
@@ -1,5 +1,5 @@
-import { ConfirmModal } from '@decky/ui';
-import { FC } from 'react';
+import { ConfirmModal, Spinner } from '@decky/ui';
+import { FC, useState } from 'react';
 
 import { uninstallPlugin } from '../../plugin';
 
@@ -12,10 +12,12 @@ interface PluginUninstallModalProps {
 }
 
 const PluginUninstallModal: FC<PluginUninstallModalProps> = ({ name, title, buttonText, description, closeModal }) => {
+  const [uninstalling, setUninstalling] = useState<boolean>(false);
   return (
     <ConfirmModal
       closeModal={closeModal}
       onOK={async () => {
+        setUninstalling(true);
         await uninstallPlugin(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
@@ -23,7 +25,12 @@ const PluginUninstallModal: FC<PluginUninstallModalProps> = ({ name, title, butt
         await DeckyPluginLoader.hiddenPluginsService.invalidate();
         closeModal?.();
       }}
-      strTitle={title}
+      bOKDisabled={uninstalling}
+      bCancelDisabled={uninstalling}
+      strTitle={<div style={{display: "flex", flexDirection: "row", alignItems: "center", width: "100%"}}>
+        {title}
+        {uninstalling && <Spinner width="24px" height="24px" style={{marginLeft: "auto"}}/>}
+      </div>}
       strOKButtonText={buttonText}
     >
       {description}
-- 
cgit v1.2.3

