| Index: Source/modules/app_banner/BeforeInstallPromptEvent.cpp
|
| diff --git a/Source/modules/app_banner/BeforeInstallPromptEvent.cpp b/Source/modules/app_banner/BeforeInstallPromptEvent.cpp
|
| index 74cdab48b06f844afaf94119b8a34e03fb48a2cc..b7259f7acf04892c9b3b3cb391c953a6ad3fe5d3 100644
|
| --- a/Source/modules/app_banner/BeforeInstallPromptEvent.cpp
|
| +++ b/Source/modules/app_banner/BeforeInstallPromptEvent.cpp
|
| @@ -49,14 +49,15 @@ Vector<String> BeforeInstallPromptEvent::platforms() const
|
|
|
| ScriptPromise BeforeInstallPromptEvent::userChoice(ScriptState* scriptState)
|
| {
|
| - if (m_userChoice.isEmpty() && m_client) {
|
| - ASSERT(m_requestId != -1);
|
| - RefPtrWillBeRawPtr<ScriptPromiseResolver> resolver = ScriptPromiseResolver::create(scriptState);
|
| - m_userChoice = resolver->promise();
|
| - m_client->registerBannerCallbacks(m_requestId, new CallbackPromiseAdapter<AppBannerPromptResult, void>(resolver));
|
| + if (!m_resolver) {
|
| + m_resolver = ScriptPromiseResolver::create(scriptState);
|
| + if (m_client) {
|
| + ASSERT(m_requestId != -1);
|
| + m_client->registerBannerCallbacks(m_requestId, new CallbackPromiseAdapter<AppBannerPromptResult, void>(m_resolver));
|
| + }
|
| }
|
|
|
| - return m_userChoice;
|
| + return m_resolver->promise();
|
| }
|
|
|
| const AtomicString& BeforeInstallPromptEvent::interfaceName() const
|
|
|