web: the offer to install is made once, and the answer is kept
This commit is contained in:
@@ -5,8 +5,8 @@ import {
|
||||
canInstall,
|
||||
dismissInstall,
|
||||
dismissed,
|
||||
isInstalled,
|
||||
isIosSafari,
|
||||
isStandalone,
|
||||
promptInstall,
|
||||
subscribe,
|
||||
} from '../pwa/install';
|
||||
@@ -30,7 +30,7 @@ export function InstallPrompt() {
|
||||
useEffect(() => {
|
||||
// An installed app has nothing to offer, and a refusal is final — the visitor
|
||||
// said no to this dialog, not to this session.
|
||||
if (isStandalone() || dismissed()) return;
|
||||
if (isInstalled() || dismissed()) return;
|
||||
|
||||
const manual = isIosSafari();
|
||||
let waited = false;
|
||||
@@ -86,8 +86,8 @@ export function InstallPrompt() {
|
||||
type="button"
|
||||
className="btn primary"
|
||||
data-key="install-yes"
|
||||
// Not a dismissal: taking the offer and waving the browser's own sheet
|
||||
// away are different answers, and the app's own button can still ask.
|
||||
// `promptInstall` records the browser's answer itself: accepted means the
|
||||
// app is installed, waved away means the offer was spent and refused.
|
||||
onClick={() => {
|
||||
void promptInstall();
|
||||
setFace(null);
|
||||
|
||||
Reference in New Issue
Block a user