Skip to content

Commit

Permalink
refactor(sdk,main-button): not important changes
Browse files Browse the repository at this point in the history
  • Loading branch information
heyqbnk committed Oct 1, 2024
1 parent 389d022 commit 2f258d7
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions packages/sdk/src/scopes/components/main-button/methods.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,16 +56,16 @@ function onInternalStateChanged(state: State): void {
setStorageValue<StorageValue>(STORAGE_KEY, state);
}

function onStateChanged(s: Required<State>) {
function onStateChanged(s: Required<State>): void {
// We should not commit changes until the payload is correct.
// Some version of Telegram will crash due to the empty value of the text.
s.text && postEvent(MINI_APPS_METHOD, {
color: s.backgroundColor,
has_shine_effect: s.hasShineEffect,
is_visible: s.isVisible,
is_active: s.isEnabled,
is_progress_visible: s.isLoaderVisible,
is_visible: s.isVisible,
text: s.text,
color: s.backgroundColor,
text_color: s.textColor,
});
}
Expand Down

0 comments on commit 2f258d7

Please sign in to comment.