Re: [w3c/manifest] Add installation prompt control flow (#417)

I think I prefer the old behaviour -- `userChoice` would be left unresolved in the case of a `prompt` error.

Leaving promises unresolved isn't a bad thing: it just means that the conditions to resolve them weren't met. I don't see a strong relation between a `prompt` error and `userChoice`; in fact you can still successfully make a choice after a prompt error. For example:

```js
window.addEventListener('beforeinstallprompt', () => {
  try {
    e.prompt();  // Error: preventDefault not called
  } catch (e) {}
  e.preventDefault();
  e.prompt();  // This is fine.
});
```

It would be bad to reject `userChoice` on the first prompt, because it's still meaningful later.

In fact, just this:

```js
window.addEventListener('beforeinstallprompt', () => {
  e.prompt();
});
```

It's going to continue with the automatic prompt after that. `userChoice` should not be rejected by the call to `prompt()`.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/w3c/manifest/issues/417#issuecomment-255007189

Received on Thursday, 20 October 2016 04:38:41 UTC