fix: tab right click rename bug (#3286)

This commit is contained in:
Nivedin 2023-08-25 00:20:08 +05:30 committed by GitHub
parent 8db452089c
commit e9509b9fa1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -150,6 +150,7 @@ const showRenamingReqNameModal = ref(false)
const reqName = ref<string>("")
const unsavedTabsCount = ref(0)
const exceptedTabID = ref<string | null>(null)
const renameTabID = ref<string | null>(null)
const t = useI18n()
const toast = useToast()
@ -257,6 +258,7 @@ const openReqRenameModal = (tabID?: string) => {
if (tabID) {
const tab = getTabRef(tabID)
reqName.value = tab.value.document.request.name
renameTabID.value = tabID
} else {
reqName.value = currentActiveTab.value.document.request.name
}
@ -264,7 +266,7 @@ const openReqRenameModal = (tabID?: string) => {
}
const renameReqName = () => {
const tab = getTabRef(currentTabID.value)
const tab = getTabRef(renameTabID.value ?? currentTabID.value)
if (tab.value) {
tab.value.document.request.name = reqName.value
updateTab(tab.value)