Remove checking source type

This commit is contained in:
Shreerang Kale 2025-05-05 10:48:48 +05:30
parent 9264a39e04
commit b90c18b794

View File

@ -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]);