collections.ts (hoppscotch-2.0.0) | : | collections.ts (hoppscotch-2.1.0) | ||
---|---|---|---|---|
skipping to change at line 263 | skipping to change at line 263 | |||
const newState = state | const newState = state | |||
const indexPaths = path.split("/").map((x) => parseInt(x)) | const indexPaths = path.split("/").map((x) => parseInt(x)) | |||
const targetLocation = navigateToFolderWithIndexPath(newState, indexPaths) | const targetLocation = navigateToFolderWithIndexPath(newState, indexPaths) | |||
if (targetLocation === null) { | if (targetLocation === null) { | |||
console.log( | console.log( | |||
`Could not resolve path '${path}'. Ignoring editRequest dispatch.` | `Could not resolve path '${path}'. Ignoring editRequest dispatch.` | |||
) | ) | |||
return {} | return {} | |||
} | } | |||
targetLocation.requests = targetLocation.requests.map((req, index) => | targetLocation.requests = targetLocation.requests.map((req, index) => | |||
index !== requestIndex ? req : requestNew | index !== requestIndex ? req : requestNew | |||
) | ) | |||
return { | return { | |||
state: newState, | state: newState, | |||
} | } | |||
skipping to change at line 290 | skipping to change at line 289 | |||
const newState = state | const newState = state | |||
const indexPaths = path.split("/").map((x) => parseInt(x)) | const indexPaths = path.split("/").map((x) => parseInt(x)) | |||
const targetLocation = navigateToFolderWithIndexPath(newState, indexPaths) | const targetLocation = navigateToFolderWithIndexPath(newState, indexPaths) | |||
if (targetLocation === null) { | if (targetLocation === null) { | |||
console.log( | console.log( | |||
`Could not resolve path '${path}'. Ignoring saveRequestAs dispatch.` | `Could not resolve path '${path}'. Ignoring saveRequestAs dispatch.` | |||
) | ) | |||
return {} | return {} | |||
} | } | |||
targetLocation.requests.push(request) | targetLocation.requests.push(request) | |||
return { | return { | |||
state: newState, | state: newState, | |||
} | } | |||
}, | }, | |||
skipping to change at line 315 | skipping to change at line 313 | |||
const newState = state | const newState = state | |||
const indexPaths = path.split("/").map((x) => parseInt(x)) | const indexPaths = path.split("/").map((x) => parseInt(x)) | |||
const targetLocation = navigateToFolderWithIndexPath(newState, indexPaths) | const targetLocation = navigateToFolderWithIndexPath(newState, indexPaths) | |||
if (targetLocation === null) { | if (targetLocation === null) { | |||
console.log( | console.log( | |||
`Could not resolve path '${path}'. Ignoring removeRequest dispatch.` | `Could not resolve path '${path}'. Ignoring removeRequest dispatch.` | |||
) | ) | |||
return {} | return {} | |||
} | } | |||
targetLocation.requests.splice(requestIndex, 1) | targetLocation.requests.splice(requestIndex, 1) | |||
// If the save context is set and is set to the same source, we invalidate i t | // If the save context is set and is set to the same source, we invalidate i t | |||
const saveCtx = getRESTSaveContext() | const saveCtx = getRESTSaveContext() | |||
if ( | if ( | |||
saveCtx?.originLocation === "user-collection" && | saveCtx?.originLocation === "user-collection" && | |||
saveCtx.folderPath === path && | saveCtx.folderPath === path && | |||
skipping to change at line 367 | skipping to change at line 364 | |||
const req = targetLocation.requests[requestIndex] | const req = targetLocation.requests[requestIndex] | |||
const destIndexPaths = destinationPath.split("/").map((x) => parseInt(x)) | const destIndexPaths = destinationPath.split("/").map((x) => parseInt(x)) | |||
const destLocation = navigateToFolderWithIndexPath(newState, destIndexPaths) | const destLocation = navigateToFolderWithIndexPath(newState, destIndexPaths) | |||
if (destLocation === null) { | if (destLocation === null) { | |||
console.log( | console.log( | |||
`Could not resolve destination path '${destinationPath}'. Skipping moveR equest dispatch.` | `Could not resolve destination path '${destinationPath}'. Skipping moveR equest dispatch.` | |||
) | ) | |||
return {} | return {} | |||
} | } | |||
destLocation.requests.push(req) | destLocation.requests.push(req) | |||
targetLocation.requests.splice(requestIndex, 1) | targetLocation.requests.splice(requestIndex, 1) | |||
return { | return { | |||
state: newState, | state: newState, | |||
} | } | |||
}, | }, | |||
skipping to change at line 536 | skipping to change at line 532 | |||
const newState = state | const newState = state | |||
const indexPaths = path.split("/").map((x) => parseInt(x)) | const indexPaths = path.split("/").map((x) => parseInt(x)) | |||
const targetLocation = navigateToFolderWithIndexPath(newState, indexPaths) | const targetLocation = navigateToFolderWithIndexPath(newState, indexPaths) | |||
if (targetLocation === null) { | if (targetLocation === null) { | |||
console.log( | console.log( | |||
`Could not resolve path '${path}'. Ignoring editRequest dispatch.` | `Could not resolve path '${path}'. Ignoring editRequest dispatch.` | |||
) | ) | |||
return {} | return {} | |||
} | } | |||
targetLocation.requests = targetLocation.requests.map((req, index) => | targetLocation.requests = targetLocation.requests.map((req, index) => | |||
index !== requestIndex ? req : requestNew | index !== requestIndex ? req : requestNew | |||
) | ) | |||
return { | return { | |||
state: newState, | state: newState, | |||
} | } | |||
skipping to change at line 563 | skipping to change at line 558 | |||
const newState = state | const newState = state | |||
const indexPaths = path.split("/").map((x) => parseInt(x)) | const indexPaths = path.split("/").map((x) => parseInt(x)) | |||
const targetLocation = navigateToFolderWithIndexPath(newState, indexPaths) | const targetLocation = navigateToFolderWithIndexPath(newState, indexPaths) | |||
if (targetLocation === null) { | if (targetLocation === null) { | |||
console.log( | console.log( | |||
`Could not resolve path '${path}'. Ignoring saveRequestAs dispatch.` | `Could not resolve path '${path}'. Ignoring saveRequestAs dispatch.` | |||
) | ) | |||
return {} | return {} | |||
} | } | |||
targetLocation.requests.push(request) | targetLocation.requests.push(request) | |||
return { | return { | |||
state: newState, | state: newState, | |||
} | } | |||
}, | }, | |||
skipping to change at line 588 | skipping to change at line 582 | |||
const newState = state | const newState = state | |||
const indexPaths = path.split("/").map((x) => parseInt(x)) | const indexPaths = path.split("/").map((x) => parseInt(x)) | |||
const targetLocation = navigateToFolderWithIndexPath(newState, indexPaths) | const targetLocation = navigateToFolderWithIndexPath(newState, indexPaths) | |||
if (targetLocation === null) { | if (targetLocation === null) { | |||
console.log( | console.log( | |||
`Could not resolve path '${path}'. Ignoring removeRequest dispatch.` | `Could not resolve path '${path}'. Ignoring removeRequest dispatch.` | |||
) | ) | |||
return {} | return {} | |||
} | } | |||
targetLocation.requests.splice(requestIndex, 1) | targetLocation.requests.splice(requestIndex, 1) | |||
// If the save context is set and is set to the same source, we invalidate i t | // If the save context is set and is set to the same source, we invalidate i t | |||
const saveCtx = getRESTSaveContext() | const saveCtx = getRESTSaveContext() | |||
if ( | if ( | |||
saveCtx?.originLocation === "user-collection" && | saveCtx?.originLocation === "user-collection" && | |||
saveCtx.folderPath === path && | saveCtx.folderPath === path && | |||
skipping to change at line 640 | skipping to change at line 633 | |||
const req = targetLocation.requests[requestIndex] | const req = targetLocation.requests[requestIndex] | |||
const destIndexPaths = destinationPath.split("/").map((x) => parseInt(x)) | const destIndexPaths = destinationPath.split("/").map((x) => parseInt(x)) | |||
const destLocation = navigateToFolderWithIndexPath(newState, destIndexPaths) | const destLocation = navigateToFolderWithIndexPath(newState, destIndexPaths) | |||
if (destLocation === null) { | if (destLocation === null) { | |||
console.log( | console.log( | |||
`Could not resolve destination path '${destinationPath}'. Skipping moveR equest dispatch.` | `Could not resolve destination path '${destinationPath}'. Skipping moveR equest dispatch.` | |||
) | ) | |||
return {} | return {} | |||
} | } | |||
destLocation.requests.push(req) | destLocation.requests.push(req) | |||
targetLocation.requests.splice(requestIndex, 1) | targetLocation.requests.splice(requestIndex, 1) | |||
return { | return { | |||
state: newState, | state: newState, | |||
} | } | |||
}, | }, | |||
End of changes. 8 change blocks. | ||||
8 lines changed or deleted | 0 lines changed or added |