fix: allow dismissing PWA install prompt in Chrome/Edge

Add close button to Chrome/Edge install prompt and respect dismissed state
when determining if prompt can be shown. iOS version already had dismiss
capability, so this brings feature parity across all supported browsers.
This commit is contained in:
weishu
2026-01-03 16:09:07 +08:00
parent 365728aed7
commit a2c4315e99
2 changed files with 11 additions and 1 deletions
+10
View File
@@ -145,6 +145,16 @@ export function InstallPrompt() {
>
Install
</button>
<button
onClick={() => {
haptic.impact('light')
dismissInstall()
}}
className="shrink-0 p-2 text-[var(--app-hint)] active:opacity-60"
aria-label="Dismiss"
>
<CloseIcon className="w-4 h-4" />
</button>
</div>
</div>
)
+1 -1
View File
@@ -117,7 +117,7 @@ export function usePWAInstall(): {
return {
installState,
canInstall: installState === 'available',
canInstall: installState === 'available' && !dismissed,
canInstallIOS: isIOS && !isStandalone && !dismissed,
isStandalone,
isIOS,