From 45cd2d4ef7bf38ecd8d1d57c4170b9dbaa912c8c Mon Sep 17 00:00:00 2001
From: xXJsonDeruloXx <danielhimebauch@gmail.com>
Date: Sat, 1 Aug 2026 16:54:06 -0400
Subject: fix: harden v2 migration and Flatpak updates

---
 src/components/InstallationButton.tsx | 58 ++++++++++++++++++++++-------------
 1 file changed, 36 insertions(+), 22 deletions(-)

(limited to 'src/components/InstallationButton.tsx')

diff --git a/src/components/InstallationButton.tsx b/src/components/InstallationButton.tsx
index 40ba955..de7d454 100644
--- a/src/components/InstallationButton.tsx
+++ b/src/components/InstallationButton.tsx
@@ -16,15 +16,24 @@ export function InstallationButton({
   onInstall,
   onUninstall
 }: InstallationButtonProps) {
-  const renderButtonContent = () => {
+  const renderInstallButtonContent = () => {
     if (isInstalling) {
       return (
         <div style={{ display: "flex", alignItems: "center", gap: "8px" }}>
-          <div>Installing...</div>
+          <div>{isInstalled ? "Updating..." : "Installing..."}</div>
         </div>
       );
     }
 
+    return (
+      <div style={{ display: "flex", alignItems: "center", gap: "8px" }}>
+        <FaDownload />
+        <div>{isInstalled ? "Update LSFG-VK" : "Install / Update LSFG-VK"}</div>
+      </div>
+    );
+  };
+
+  const renderUninstallButtonContent = () => {
     if (isUninstalling) {
       return (
         <div style={{ display: "flex", alignItems: "center", gap: "8px" }}>
@@ -33,32 +42,37 @@ export function InstallationButton({
       );
     }
 
-    if (isInstalled) {
-      return (
-        <div style={{ display: "flex", alignItems: "center", gap: "8px" }}>
-          <FaTrash />
-          <div>Uninstall LSFG-VK</div>
-        </div>
-      );
-    }
-
     return (
       <div style={{ display: "flex", alignItems: "center", gap: "8px" }}>
-        <FaDownload />
-        <div>Install / Update LSFG-VK</div>
+        <FaTrash />
+        <div>Uninstall LSFG-VK</div>
       </div>
     );
   };
 
   return (
-    <PanelSectionRow>
-      <ButtonItem
-        layout="below"
-        onClick={isInstalled ? onUninstall : onInstall}
-        disabled={isInstalling || isUninstalling}
-      >
-        {renderButtonContent()}
-      </ButtonItem>
-    </PanelSectionRow>
+    <>
+      <PanelSectionRow>
+        <ButtonItem
+          layout="below"
+          onClick={onInstall}
+          disabled={isInstalling || isUninstalling}
+        >
+          {renderInstallButtonContent()}
+        </ButtonItem>
+      </PanelSectionRow>
+
+      {isInstalled && (
+        <PanelSectionRow>
+          <ButtonItem
+            layout="below"
+            onClick={onUninstall}
+            disabled={isInstalling || isUninstalling}
+          >
+            {renderUninstallButtonContent()}
+          </ButtonItem>
+        </PanelSectionRow>
+      )}
+    </>
   );
 }
-- 
cgit v1.2.3

