From 9071ac6406ce2057767060da940982575aff5a42 Mon Sep 17 00:00:00 2001 From: AnhMTV Date: Wed, 7 Aug 2024 23:21:43 +0700 Subject: [PATCH] Update not enough energy notification --- .../extension-koni-ui/src/Popup/Home/Games/gameSDK.ts | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/packages/extension-koni-ui/src/Popup/Home/Games/gameSDK.ts b/packages/extension-koni-ui/src/Popup/Home/Games/gameSDK.ts index 7d2e0dfd95..7f286c8ff8 100644 --- a/packages/extension-koni-ui/src/Popup/Home/Games/gameSDK.ts +++ b/packages/extension-koni-ui/src/Popup/Home/Games/gameSDK.ts @@ -7,9 +7,9 @@ import { SWStorage } from '@subwallet/extension-base/storage'; import { addLazy, createPromiseHandler, removeLazy } from '@subwallet/extension-base/utils'; import { BookaSdk } from '@subwallet/extension-koni-ui/connector/booka/sdk'; import { Game } from '@subwallet/extension-koni-ui/connector/booka/types'; +import { TelegramConnector } from '@subwallet/extension-koni-ui/connector/telegram'; import { camelCase } from 'lodash'; import z from 'zod'; -import {TelegramConnector} from "@subwallet/extension-koni-ui/connector/telegram"; export interface GameAppOptions { viewport: HTMLIFrameElement; @@ -323,14 +323,15 @@ export class GameApp { try { await this.onPlay(); - this.apiSDK.reloadAccount().catch(console.error); - this.gameStateHandler.resolve(state || {} as GameState); } catch (e) { + this.onExit(); telegramConnector.showAlert('Not enough energy to play', () => { - this.onExit(); + console.log('alert closed'); }); throw e; + } finally { + this.apiSDK.reloadAccount().catch(console.error); } }