Skip to content

Commit 5af106f

Browse files
authored
fix(api): update message handling to check for undefined response (#129)
1 parent 7ee1086 commit 5af106f

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

api/browser.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ export class KastleBrowserAPI {
186186
const onMessage = async (event: MessageEvent<unknown>) => {
187187
try {
188188
const result = callback(event);
189-
if (!result) {
189+
if (result === undefined) {
190190
return; // Skip if the result is empty, which means the message is not for this channel
191191
}
192192

api/ethereum.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ export class EthereumBrowserAPI {
126126
const onMessage = async (event: MessageEvent<unknown>) => {
127127
try {
128128
const result = callback(event);
129-
if (!result) {
129+
if (result === undefined) {
130130
return; // Skip if the result is empty, which means the message is not for this channel
131131
}
132132

0 commit comments

Comments
 (0)