Skip to content

Commit

Permalink
fix(ui): closing a tab when there are no other tabs, creates "parent_…
Browse files Browse the repository at this point in the history
…id of undefined" console error from store's updateActiveTabEnvironmentResolved method, as store.activeTab becomes null
  • Loading branch information
flawiddsouza committed Jan 19, 2024
1 parent fd60eec commit 8f7cf46
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions packages/ui/src/store.js
Original file line number Diff line number Diff line change
Expand Up @@ -801,6 +801,10 @@ const store = createStore({
context.commit('setCollection', await getCollectionForWorkspace(context.state.activeWorkspace._id))
},
async updateActiveTabEnvironmentResolved(context) {
if(!context.state.activeTab) {
// console.warn('updateActiveTabEnvironmentResolved called without an active tab')
return
}
const { environment } = await context.dispatch('getEnvironmentForRequest', context.state.activeTab)
context.state.activeTabEnvironmentResolved = environment
}
Expand Down

0 comments on commit 8f7cf46

Please sign in to comment.