Skip to content

Commit

Permalink
fix(init): send iframe_will_reload on reload_iframe
Browse files Browse the repository at this point in the history
  • Loading branch information
heyqbnk committed Mar 9, 2024
1 parent 1ca4822 commit 1226ad1
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion packages/sdk/src/init/init.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,10 @@ export function init(options: InitOptions = {}): InitResult | Promise<InitResult
// application which is used in catchCustomStyles function. We should call this method also
// to start receiving "reload_iframe" events from the Telegram application.
postEvent('iframe_ready', { reload_supported: true });
on('reload_iframe', () => window.location.reload());
on('reload_iframe', () => {
postEvent('iframe_will_reload');
window.location.reload();
});
}

const result: Omit<InitResult, 'viewport'> = {
Expand Down

0 comments on commit 1226ad1

Please sign in to comment.