mirror of
https://github.com/keepassxreboot/keepassxc-browser.git
synced 2026-03-11 08:54:43 +00:00
Merge pull request #1940 from keepassxreboot/fix/handle_errors
Handle errors properly when waiting for response
This commit is contained in:
commit
eb3657ead8
1 changed files with 1 additions and 1 deletions
|
|
@ -83,7 +83,7 @@ keepassClient.sendNativeMessage = function(request, enableTimeout = false, timeo
|
|||
const handler = (msg) => {
|
||||
if (msg && msg?.action === action) {
|
||||
// If the request has a separate requestID, check if it matches when there's no nonce (an error message)
|
||||
const isNotificationOrError = !msg.nonce && request.requestID === msg.requestID;
|
||||
const isNotificationOrError = !msg.nonce && (request.requestID === msg.requestID || (msg.error && msg.errorCode));
|
||||
|
||||
// Only resolve a matching response or a notification (without nonce)
|
||||
if (isNotificationOrError || messageBuffer.matchAndRemove(msg)) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue