Remove checking source type
This commit is contained in:
parent
9264a39e04
commit
b90c18b794
@ -107,12 +107,8 @@ export const SignTxEmbed = () => {
|
||||
} catch (error: unknown) {
|
||||
console.error(`Error handling ${REQUEST_COSMOS_ACCOUNTS_DATA}:`, error);
|
||||
const errorMsg = error instanceof Error ? error.message : String(error);
|
||||
// Check if source is a Window before sending message
|
||||
if (source instanceof Window) {
|
||||
sendMessage(source, COSMOS_ACCOUNTS_RESPONSE, { id, error: `Failed to get accounts: ${errorMsg}` }, origin);
|
||||
} else {
|
||||
console.error("Cannot send error message: source is not a Window");
|
||||
}
|
||||
|
||||
sendMessage(source, COSMOS_ACCOUNTS_RESPONSE, { id, error: `Failed to get accounts: ${errorMsg}` }, origin);
|
||||
}
|
||||
}, [networksData]);
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user