mirror of
https://github.com/usebruno/bruno.git
synced 2024-11-25 17:33:28 +01:00
Fixes for getNextRequest in UI
This commit is contained in:
parent
4a1d45f458
commit
d76253ea04
@ -1303,29 +1303,29 @@ export const collectionsSlice = createSlice({
|
||||
}
|
||||
|
||||
if (type === 'request-sent') {
|
||||
const item = collection.runnerResult.items.find((i) => i.uid === request.uid);
|
||||
const item = collection.runnerResult.items.find((i) => i.uid === request.uid && i.status === 'queued');
|
||||
item.status = 'running';
|
||||
item.requestSent = action.payload.requestSent;
|
||||
}
|
||||
|
||||
if (type === 'response-received') {
|
||||
const item = collection.runnerResult.items.find((i) => i.uid === request.uid);
|
||||
const item = collection.runnerResult.items.find((i) => i.uid === request.uid && i.status === 'running');
|
||||
item.status = 'completed';
|
||||
item.responseReceived = action.payload.responseReceived;
|
||||
}
|
||||
|
||||
if (type === 'test-results') {
|
||||
const item = collection.runnerResult.items.find((i) => i.uid === request.uid);
|
||||
const item = collection.runnerResult.items.find((i) => i.uid === request.uid && i.status === 'running');
|
||||
item.testResults = action.payload.testResults;
|
||||
}
|
||||
|
||||
if (type === 'assertion-results') {
|
||||
const item = collection.runnerResult.items.find((i) => i.uid === request.uid);
|
||||
const item = collection.runnerResult.items.find((i) => i.uid === request.uid && i.status === 'running');
|
||||
item.assertionResults = action.payload.assertionResults;
|
||||
}
|
||||
|
||||
if (type === 'error') {
|
||||
const item = collection.runnerResult.items.find((i) => i.uid === request.uid);
|
||||
const item = collection.runnerResult.items.find((i) => i.uid === request.uid && i.status === 'running');
|
||||
item.error = action.payload.error;
|
||||
item.responseReceived = action.payload.responseReceived;
|
||||
item.status = 'error';
|
||||
|
@ -373,7 +373,7 @@ const handler = async function (argv) {
|
||||
const nextRequestName = result?.nextRequestName;
|
||||
if (nextRequestName) {
|
||||
const nextRequestIdx = bruJsons.findIndex((iter) => iter.bruJson.name === nextRequestName);
|
||||
if (nextRequestIdx > 0) {
|
||||
if (nextRequestIdx >= 0) {
|
||||
currentRequestIndex = nextRequestIdx;
|
||||
} else {
|
||||
console.error("Could not find request with name '" + nextRequestName + "'");
|
||||
|
@ -866,7 +866,7 @@ const registerNetworkIpc = (mainWindow) => {
|
||||
}
|
||||
if (nextRequestName) {
|
||||
const nextRequestIdx = folderRequests.findIndex((request) => request.name === nextRequestName);
|
||||
if (nextRequestIdx > 0) {
|
||||
if (nextRequestIdx >= 0) {
|
||||
currentRequestIndex = nextRequestIdx;
|
||||
} else {
|
||||
console.error("Could not find request with name '" + nextRequestName + "'");
|
||||
|
Loading…
Reference in New Issue
Block a user