Skip to content

Commit

Permalink
Merge branch 'fix/sign-helper' into tmp/20241101
Browse files Browse the repository at this point in the history
  • Loading branch information
heisenberg-2077 committed Nov 1, 2024
2 parents e21acfa + 7fe84a9 commit 9d7b9d1
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
1 change: 1 addition & 0 deletions src/ui/utils/sendTransaction.ts
Original file line number Diff line number Diff line change
Expand Up @@ -473,6 +473,7 @@ export const sendTransaction = async ({
await handleSendAfter();
const err = new Error(e.message);
err.name = FailedCode.SubmitTxFailed;
eventBus.emit(EVENTS.COMMON_HARDWARE.REJECTED, e.message);
throw err;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,10 +89,10 @@ export const MiniLedgerAction: React.FC<Props> = ({
}
};

eventBus.addEventListener(EVENTS.LEDGER.REJECTED, listener);
eventBus.addEventListener(EVENTS.COMMON_HARDWARE.REJECTED, listener);

return () => {
eventBus.removeEventListener(EVENTS.LEDGER.REJECTED, listener);
eventBus.removeEventListener(EVENTS.COMMON_HARDWARE.REJECTED, listener);
};
}, []);

Expand All @@ -106,7 +106,7 @@ export const MiniLedgerAction: React.FC<Props> = ({

React.useEffect(() => {
if (task.status === 'active' && status === 'DISCONNECTED') {
eventBus.emit(EVENTS.LEDGER.REJECTED, 'DISCONNECTED');
eventBus.emit(EVENTS.COMMON_HARDWARE.REJECTED, 'DISCONNECTED');
}
}, [task.status, status]);
const { t } = useTranslation();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,16 +59,16 @@ export const RevokeActionLedgerButton: React.FC<{
}
};

eventBus.addEventListener(EVENTS.LEDGER.REJECTED, listener);
eventBus.addEventListener(EVENTS.COMMON_HARDWARE.REJECTED, listener);

return () => {
eventBus.removeEventListener(EVENTS.LEDGER.REJECTED, listener);
eventBus.removeEventListener(EVENTS.COMMON_HARDWARE.REJECTED, listener);
};
}, [task.addRevokeTask]);

React.useEffect(() => {
if (task.status === 'active' && status === 'DISCONNECTED') {
eventBus.emit(EVENTS.LEDGER.REJECTED, 'DISCONNECTED');
eventBus.emit(EVENTS.COMMON_HARDWARE.REJECTED, 'DISCONNECTED');
}
}, [task.status, status]);

Expand Down

0 comments on commit 9d7b9d1

Please sign in to comment.