From 664f59a9cc64febf243157932608611c04797cd9 Mon Sep 17 00:00:00 2001 From: Gigi Date: Wed, 15 Oct 2025 18:48:03 +0200 Subject: [PATCH] refactor: show PWA button state with checkmark when installed instead of hiding section --- src/components/Settings/PWASettings.tsx | 25 +++++-------------------- 1 file changed, 5 insertions(+), 20 deletions(-) diff --git a/src/components/Settings/PWASettings.tsx b/src/components/Settings/PWASettings.tsx index 623eafc4..a29484dc 100644 --- a/src/components/Settings/PWASettings.tsx +++ b/src/components/Settings/PWASettings.tsx @@ -7,30 +7,14 @@ const PWASettings: React.FC = () => { const { isInstallable, isInstalled, installApp } = usePWAInstall() const handleInstall = async () => { + if (isInstalled) return const success = await installApp() if (success) { console.log('App installed successfully') } } - if (isInstalled) { - return ( -
-

App

-
-
- - Boris is installed as an app -
-

- You can launch Boris from your home screen or app drawer. -

-
-
- ) - } - - if (!isInstallable) { + if (!isInstallable && !isInstalled) { return null } @@ -50,9 +34,10 @@ const PWASettings: React.FC = () => { onClick={handleInstall} className="zap-preset-btn" style={{ display: 'flex', alignItems: 'center', gap: '0.5rem' }} + disabled={isInstalled} > - - Install App + + {isInstalled ? 'Installed' : 'Install App'}