Skip to content

Commit 15a74f0

Browse files
committed
fix(rn): default topInset to 0 in embedUrl when not provided
1 parent dd26e9b commit 15a74f0

3 files changed

Lines changed: 3 additions & 4 deletions

File tree

‎dist/ChattyEmbedView.js‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,8 +92,7 @@ export function ChattyEmbedView(props) {
9292
params.set("safeArea", "true");
9393
if (voiceOnly)
9494
params.set("voice", "only");
95-
if (typeof topInset === "number")
96-
params.set("topInset", String(Math.round(topInset)));
95+
params.set("topInset", String(typeof topInset === "number" ? Math.round(topInset) : 0));
9796
if (typeof bottomInset === "number")
9897
params.set("bottomInset", String(Math.round(bottomInset)));
9998
return `${base}?${params.toString()}`;

‎package.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@personaliai/react-native",
3-
"version": "1.2.0",
3+
"version": "1.2.1",
44
"description": "Official React Native SDK for Chatty AI chatbots — loads the web widget in a WebView for guaranteed parity, with native components as an alternative",
55
"main": "dist/index.js",
66
"types": "dist/index.d.ts",

‎src/ChattyEmbedView.tsx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ export function ChattyEmbedView(props: ChattyEmbedViewProps) {
174174
params.set("platform", "react-native");
175175
params.set("safeArea", "true");
176176
if (voiceOnly) params.set("voice", "only");
177-
if (typeof topInset === "number") params.set("topInset", String(Math.round(topInset)));
177+
params.set("topInset", String(typeof topInset === "number" ? Math.round(topInset) : 0));
178178
if (typeof bottomInset === "number") params.set("bottomInset", String(Math.round(bottomInset)));
179179
return `${base}?${params.toString()}`;
180180
}, [baseUrl, botId, voiceOnly, topInset, bottomInset]);

0 commit comments

Comments
 (0)