Skip to content

Commit

Permalink
Merge pull request #509 from Telegram-Mini-Apps/fix/mini-app-mount
Browse files Browse the repository at this point in the history
Fix/mini app mount
  • Loading branch information
heyqbnk authored Oct 18, 2024
2 parents b026c6a + 467593f commit eda464f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
5 changes: 5 additions & 0 deletions .changeset/loud-sheep-press.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@telegram-apps/sdk": patch
---

Fix invalid Mini App mount using theme params RGB header color
5 changes: 1 addition & 4 deletions packages/sdk/src/scopes/components/mini-app/methods.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,6 @@ import { computed, type Computed } from '@telegram-apps/signals';
import { $version, postEvent } from '@/scopes/globals.js';
import { ERR_ALREADY_CALLED } from '@/errors.js';
import { mount as tpMount } from '@/scopes/components/theme-params/methods.js';
import {
headerBackgroundColor as tpHeaderBackgroundColor,
} from '@/scopes/components/theme-params/signals.js';
import { subAndCall } from '@/utils/subAndCall.js';
import { withSupports } from '@/scopes/toolkit/withSupports.js';
import { withIsSupported } from '@/scopes/toolkit/withIsSupported.js';
Expand Down Expand Up @@ -139,7 +136,7 @@ export const mount = withComponentSupported((): void => {

backgroundColor.set(s ? s.backgroundColor : 'bg_color');
bottomBarColor.set(s ? s.bottomBarColor : 'bottom_bar_bg_color');
headerColor.set(s ? s.headerColor : tpHeaderBackgroundColor() || 'bg_color');
headerColor.set(s ? s.headerColor : 'bg_color');

setBackgroundColor.isSupported() && subAndCall(backgroundColor, onBgColorChanged);
setBottomBarColor.isSupported() && subAndCall(bottomBarColor, onBottomBarBgColorChanged);
Expand Down

0 comments on commit eda464f

Please sign in to comment.