mirror of
https://github.com/dergigi/boris.git
synced 2025-12-27 11:34:50 +01:00
fix: disable PWA install button when installation is not possible on device
This commit is contained in:
@@ -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'}
|
||||
|
||||
@@ -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(() => {
|
||||
|
||||
Reference in New Issue
Block a user