Skip to content

Commit

Permalink
Update not enough energy notification
Browse files Browse the repository at this point in the history
  • Loading branch information
saltict committed Aug 7, 2024
1 parent 35311c7 commit 9071ac6
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions packages/extension-koni-ui/src/Popup/Home/Games/gameSDK.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -323,14 +323,15 @@ export class GameApp {
try {
await this.onPlay();

this.apiSDK.reloadAccount().catch(console.error);

this.gameStateHandler.resolve(state || {} as GameState<any>);
} 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);
}
}

Expand Down

0 comments on commit 9071ac6

Please sign in to comment.