From 5d1be2f18a859280a8f9d95011bbe82d8aa324a9 Mon Sep 17 00:00:00 2001 From: Anoop M D Date: Fri, 13 Oct 2023 07:13:18 +0530 Subject: [PATCH] chore: dispatch null response when req is cancelled --- .../ReduxStore/slices/collections/actions.js | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/packages/bruno-app/src/providers/ReduxStore/slices/collections/actions.js b/packages/bruno-app/src/providers/ReduxStore/slices/collections/actions.js index fb384c52..80c82345 100644 --- a/packages/bruno-app/src/providers/ReduxStore/slices/collections/actions.js +++ b/packages/bruno-app/src/providers/ReduxStore/slices/collections/actions.js @@ -144,17 +144,22 @@ export const sendRequest = (item, collectionUid) => (dispatch, getState) => { .catch((err) => { if (err && err.message === "Error invoking remote method 'send-http-request': Error: Request cancelled") { console.log('>> request cancelled'); + dispatch( + responseReceived({ + itemUid: item.uid, + collectionUid: collectionUid, + response: null + }) + ); return; } - const errorMessage = err.message ?? 'Something went wrong'; - const errorResponse = { status: 'Error', isError: true, - error: errorMessage, - size: '0', - duration: '0' + error: err.message ?? 'Something went wrong', + size: 0, + duration: 0 }; dispatch(