fix: make close all tabs action account for tabs with invalid request handles
This commit is contained in:
@@ -86,7 +86,22 @@ export class RESTTabService extends TabService<HoppRESTDocument> {
|
|||||||
let count = 0
|
let count = 0
|
||||||
|
|
||||||
for (const tab of this.tabMap.values()) {
|
for (const tab of this.tabMap.values()) {
|
||||||
if (tab.document.isDirty) count++
|
if (tab.document.isDirty) {
|
||||||
|
count++
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
if (
|
||||||
|
tab.document.saveContext?.originLocation === "workspace-user-collection"
|
||||||
|
) {
|
||||||
|
const requestHandle = tab.document.saveContext.requestHandle as
|
||||||
|
| HandleRef<WorkspaceRequest>["value"]
|
||||||
|
| undefined
|
||||||
|
|
||||||
|
if (requestHandle?.type === "invalid") {
|
||||||
|
count++
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return count
|
return count
|
||||||
|
|||||||
Reference in New Issue
Block a user