diff options
Diffstat (limited to 'packages/taler-wallet-webextension/src/taler-wallet-interaction-loader.ts')
-rw-r--r-- | packages/taler-wallet-webextension/src/taler-wallet-interaction-loader.ts | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/packages/taler-wallet-webextension/src/taler-wallet-interaction-loader.ts b/packages/taler-wallet-webextension/src/taler-wallet-interaction-loader.ts index cc5a02260..8ea071fb6 100644 --- a/packages/taler-wallet-webextension/src/taler-wallet-interaction-loader.ts +++ b/packages/taler-wallet-webextension/src/taler-wallet-interaction-loader.ts @@ -14,7 +14,7 @@ GNU Taler; see the file COPYING. If not, see <http://www.gnu.org/licenses/> */ -import { CoreApiResponse } from "@gnu-taler/taler-util"; +import { CoreApiResponse, TalerError, TalerErrorCode } from "@gnu-taler/taler-util"; /** * This will modify all the pages that the user load when navigating with Web Extension enabled @@ -183,9 +183,8 @@ async function sendMessageToBackground<Op extends keyof ExtensionOperations>( let timedout = false; const timerId = setTimeout(() => { timedout = true; - throw new Error("timeout"); - // throw TalerError.fromDetail(TalerErrorCode.GENERIC_TIMEOUT, {}); - }, 5 * 1000); //five seconds + reject(TalerError.fromDetail(TalerErrorCode.GENERIC_TIMEOUT, {})) + }, 20 * 1000); //five seconds chrome.runtime.sendMessage(messageWithId, (backgroundResponse) => { if (timedout) { return false; //already rejected |