Update reject request handler

This commit is contained in:
Shreerang Kale 2025-04-30 15:13:10 +05:30
parent 0a591077cd
commit b7cda1da18

View File

@ -273,11 +273,7 @@ export const SendTxEmbed = () => {
const { requestId, source, origin } = transactionDetails;
console.log("Rejecting request:", requestId);
// Check if source is a Window before sending message
if (source instanceof Window) {
sendMessage(source, SIGN_ONBOARD_TX_RESPONSE, {id: requestId, error: "User rejected the signature request." }, origin);
} else {
console.error("Cannot send rejection message: source is not a Window");
}
sendMessage(source as Window, SIGN_ONBOARD_TX_RESPONSE, {id: requestId, error: "User rejected the signature request." }, origin);
setIsTxApprovalVisible(false);
setTransactionDetails(null);
setTxError(null);