mirror of
https://github.com/usebruno/bruno.git
synced 2024-11-22 16:03:39 +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') {
|
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.status = 'running';
|
||||||
item.requestSent = action.payload.requestSent;
|
item.requestSent = action.payload.requestSent;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (type === 'response-received') {
|
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.status = 'completed';
|
||||||
item.responseReceived = action.payload.responseReceived;
|
item.responseReceived = action.payload.responseReceived;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (type === 'test-results') {
|
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;
|
item.testResults = action.payload.testResults;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (type === 'assertion-results') {
|
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;
|
item.assertionResults = action.payload.assertionResults;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (type === 'error') {
|
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.error = action.payload.error;
|
||||||
item.responseReceived = action.payload.responseReceived;
|
item.responseReceived = action.payload.responseReceived;
|
||||||
item.status = 'error';
|
item.status = 'error';
|
||||||
|
@ -373,7 +373,7 @@ const handler = async function (argv) {
|
|||||||
const nextRequestName = result?.nextRequestName;
|
const nextRequestName = result?.nextRequestName;
|
||||||
if (nextRequestName) {
|
if (nextRequestName) {
|
||||||
const nextRequestIdx = bruJsons.findIndex((iter) => iter.bruJson.name === nextRequestName);
|
const nextRequestIdx = bruJsons.findIndex((iter) => iter.bruJson.name === nextRequestName);
|
||||||
if (nextRequestIdx > 0) {
|
if (nextRequestIdx >= 0) {
|
||||||
currentRequestIndex = nextRequestIdx;
|
currentRequestIndex = nextRequestIdx;
|
||||||
} else {
|
} else {
|
||||||
console.error("Could not find request with name '" + nextRequestName + "'");
|
console.error("Could not find request with name '" + nextRequestName + "'");
|
||||||
|
@ -866,7 +866,7 @@ const registerNetworkIpc = (mainWindow) => {
|
|||||||
}
|
}
|
||||||
if (nextRequestName) {
|
if (nextRequestName) {
|
||||||
const nextRequestIdx = folderRequests.findIndex((request) => request.name === nextRequestName);
|
const nextRequestIdx = folderRequests.findIndex((request) => request.name === nextRequestName);
|
||||||
if (nextRequestIdx > 0) {
|
if (nextRequestIdx >= 0) {
|
||||||
currentRequestIndex = nextRequestIdx;
|
currentRequestIndex = nextRequestIdx;
|
||||||
} else {
|
} else {
|
||||||
console.error("Could not find request with name '" + nextRequestName + "'");
|
console.error("Could not find request with name '" + nextRequestName + "'");
|
||||||
|
Loading…
Reference in New Issue
Block a user