File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 33 mountBackButton ,
44 restoreInitData ,
55 init as initSDK ,
6- mountMiniApp ,
76 bindThemeParamsCssVars ,
87 mountViewport ,
98 bindViewportCssVars ,
@@ -12,6 +11,7 @@ import {
1211 themeParamsState ,
1312 retrieveLaunchParams ,
1413 emitEvent ,
14+ miniApp ,
1515} from '@telegram-apps/sdk-react' ;
1616
1717/**
@@ -62,12 +62,13 @@ export async function init(options: {
6262 // Mount all components used in the project.
6363 mountBackButton . ifAvailable ( ) ;
6464 restoreInitData ( ) ;
65- await Promise . all ( [
66- mountMiniApp . isAvailable ( ) && mountMiniApp ( ) . then ( ( ) => {
67- bindThemeParamsCssVars ( ) ;
68- } ) ,
69- mountViewport . isAvailable ( ) && mountViewport ( ) . then ( ( ) => {
70- bindViewportCssVars ( ) ;
71- } ) ,
72- ] ) ;
65+
66+ if ( miniApp . mountSync . isAvailable ( ) ) {
67+ miniApp . mountSync ( ) ;
68+ bindThemeParamsCssVars ( ) ;
69+ }
70+
71+ mountViewport . isAvailable ( ) && mountViewport ( ) . then ( ( ) => {
72+ bindViewportCssVars ( ) ;
73+ } ) ;
7374}
You can’t perform that action at this time.
0 commit comments