mirror of
https://github.com/wu736139669/hapi.git
synced 2026-08-05 06:24:37 +00:00
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:
@@ -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>
|
||||
)
|
||||
|
||||
@@ -117,7 +117,7 @@ export function usePWAInstall(): {
|
||||
|
||||
return {
|
||||
installState,
|
||||
canInstall: installState === 'available',
|
||||
canInstall: installState === 'available' && !dismissed,
|
||||
canInstallIOS: isIOS && !isStandalone && !dismissed,
|
||||
isStandalone,
|
||||
isIOS,
|
||||
|
||||
Reference in New Issue
Block a user