Skip to content

Commit ac7192d

Browse files
authored
Merge pull request #875 from itsLuuke/fix/optional-tgWebAppThemeParams-launch-params
fix: default tgWebAppThemeParams to empty object when missing from launch params
2 parents 8007350 + 279de3a commit ac7192d

2 files changed

Lines changed: 6 additions & 1 deletion

File tree

.changeset/sour-moose-pull.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@tma.js/transformers": minor
3+
---
4+
5+
fix: default tgWebAppThemeParams to empty object when missing from launch params

packages/transformers/src/structures.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ export function launchParams() {
130130
tgWebAppPlatform: string(),
131131
tgWebAppShowSettings: optBool,
132132
tgWebAppStartParam: optional(string()),
133-
tgWebAppThemeParams: pipeJsonToSchema(themeParams()),
133+
tgWebAppThemeParams: optional(pipeJsonToSchema(themeParams()), {}),
134134
tgWebAppVersion: string(),
135135
} satisfies { [K in keyof LaunchParams]-?: BaseSchema<any, LaunchParams[K], any> });
136136
}

0 commit comments

Comments
 (0)