Skip to content

Commit

Permalink
fix: make close all tabs action account for tabs with invalid request…
Browse files Browse the repository at this point in the history
… handles
  • Loading branch information
jamesgeorge007 committed May 1, 2024
1 parent 48792d4 commit fcea882
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion packages/hoppscotch-common/src/services/tab/rest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,22 @@ export class RESTTabService extends TabService<HoppRESTDocument> {
let count = 0

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
Expand Down

0 comments on commit fcea882

Please sign in to comment.