fix: no page rendering issue after navigating from rest page (#2962)

This commit is contained in:
Anwarul Islam
2023-04-04 21:18:32 +06:00
committed by GitHub
parent c3c3fc6720
commit dd72eacd21
2 changed files with 56 additions and 55 deletions

View File

@@ -1185,7 +1185,7 @@ const onRemoveRequest = () => {
}) })
if (possibleTab) { if (possibleTab) {
possibleTab.value.document.saveContext = undefined possibleTab.value.document.saveContext = null
possibleTab.value.document.isDirty = true possibleTab.value.document.isDirty = true
} }
} }

View File

@@ -1,59 +1,60 @@
<template> <template>
<AppPaneLayout layout-id="http"> <div>
<template #primary> <AppPaneLayout layout-id="http">
<HoppSmartWindows <template #primary>
v-if="currentTabID" <HoppSmartWindows
:id="'rest_windows'" v-if="currentTabID"
v-model="currentTabID" :id="'rest_windows'"
@remove-tab="removeTab" v-model="currentTabID"
@add-tab="addNewTab" @remove-tab="removeTab"
@sort="sortTabs" @add-tab="addNewTab"
> @sort="sortTabs"
<HoppSmartWindow
v-for="tab in tabs"
:id="tab.id"
:key="tab.id"
:label="tab.document.request.name"
:is-removable="tabs.length > 1"
> >
<template #tabhead> <HoppSmartWindow
<span v-for="tab in tabs"
class="font-semibold truncate text-tiny w-10" :id="tab.id"
:class="getMethodLabelColorClassOf(tab.document.request)" :key="tab.id"
> :label="tab.document.request.name"
{{ tab.document.request.method }} :is-removable="tabs.length > 1"
</span> >
<span class="text-green-600 mr-1" v-if="tab.document.isDirty"> <template #tabhead>
<span
</span> class="font-semibold truncate text-tiny w-10"
<span class="truncate flex-1"> :class="getMethodLabelColorClassOf(tab.document.request)"
{{ tab.document.request.name }} >
</span> {{ tab.document.request.method }}
</template> </span>
<span class="text-green-600 mr-1" v-if="tab.document.isDirty">
<HttpRequestTab
:model-value="tab" </span>
@update:model-value="onTabUpdate" <span class="truncate flex-1">
/> {{ tab.document.request.name }}
</HoppSmartWindow> </span>
</HoppSmartWindows> </template>
</template> <HttpRequestTab
<template #sidebar> :model-value="tab"
<HttpSidebar /> @update:model-value="onTabUpdate"
</template> />
</AppPaneLayout> </HoppSmartWindow>
<HoppSmartConfirmModal </HoppSmartWindows>
:show="confirmingCloseForTabID !== null" </template>
:confirm="t('modal.close_unsaved_tab')" <template #sidebar>
:title="t('confirm.save_unsaved_tab')" <HttpSidebar />
@hide-modal="onCloseConfirmSaveTab" </template>
@resolve="onResolveConfirmSaveTab" </AppPaneLayout>
/> <HoppSmartConfirmModal
<CollectionsSaveRequest :show="confirmingCloseForTabID !== null"
:show="savingRequest" :confirm="t('modal.close_unsaved_tab')"
:mode="'rest'" :title="t('confirm.save_unsaved_tab')"
@hide-modal="onSaveModalClose" @hide-modal="onCloseConfirmSaveTab"
/> @resolve="onResolveConfirmSaveTab"
/>
<CollectionsSaveRequest
:show="savingRequest"
:mode="'rest'"
@hide-modal="onSaveModalClose"
/>
</div>
</template> </template>
<script lang="ts" setup> <script lang="ts" setup>