Skip to content

Commit d946821

Browse files
authored
Merge pull request #26 from refreakk/master
fix mountMiniApp for MacOS
2 parents 5921275 + 658d03a commit d946821

1 file changed

Lines changed: 10 additions & 9 deletions

File tree

src/init.ts

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ import {
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
}

0 commit comments

Comments
 (0)