fix: ensure request name updates reflect immediately on the tabs

This commit is contained in:
jamesgeorge007
2024-04-28 17:24:57 +05:30
parent 90c9f2a9b1
commit e5e1260632
2 changed files with 12 additions and 5 deletions

View File

@@ -1267,6 +1267,15 @@ const onEditRequest = async (newRequestName: string) => {
return
}
const possibleTab = tabs.getTabRefWithSaveContext({
originLocation: "workspace-user-collection",
requestHandle,
})
if (possibleTab) {
possibleTab.value.document.isDirty = false
}
displayModalEditRequest(false)
toast.success(t("request.renamed"))
}
@@ -1692,13 +1701,11 @@ const dropRequest = async (payload: {
const { auth, headers } = cascadingAuthHeadersHandle.value.data
const { providerID, requestID, workspaceID } = requestHandle.value.data
const { providerID, workspaceID } = requestHandle.value.data
const possibleTab = tabs.getTabRefWithSaveContext({
originLocation: "workspace-user-collection",
workspaceID,
providerID,
requestID,
requestHandle,
})
// If there is a tab attached to this request, update its save context

View File

@@ -457,7 +457,7 @@ export class PersonalWorkspaceProviderService
if ("requestID" in handle.value.data) {
if (handle.value.data.requestID === requestID) {
// @ts-expect-error - We're updating the request data
this.issuedHandles[idx].value.data.request = newRequest
this.issuedHandles[idx].value.data.request.name = newRequest.name
}
}
}