fix: disable PWA install button when installation is not possible on device

This commit is contained in:
Gigi
2025-10-15 19:37:57 +02:00
parent 2e2de4ccda
commit 1a42a6422d
2 changed files with 2 additions and 3 deletions

View File

@@ -190,7 +190,7 @@ const PWASettings: React.FC<PWASettingsProps> = ({ settings, onUpdate, onClose }
onClick={handleInstall}
className="zap-preset-btn"
style={{ display: 'flex', alignItems: 'center', gap: '0.5rem' }}
disabled={isInstalled}
disabled={isInstalled || !isInstallable}
>
<FontAwesomeIcon icon={isInstalled ? faCheckCircle : faDownload} />
{isInstalled ? 'Installed' : 'Install App'}

View File

@@ -7,8 +7,7 @@ interface BeforeInstallPromptEvent extends Event {
export function usePWAInstall() {
const [deferredPrompt, setDeferredPrompt] = useState<BeforeInstallPromptEvent | null>(null)
// TODO: Remove this - temporarily always showing for testing/styling
const [isInstallable, setIsInstallable] = useState(true)
const [isInstallable, setIsInstallable] = useState(false)
const [isInstalled, setIsInstalled] = useState(false)
useEffect(() => {