Skip to content

Commit

Permalink
Reset currentViewIndex to zero when deleting current view
Browse files Browse the repository at this point in the history
  • Loading branch information
rafaellehmkuhl authored and patrickelectric committed Aug 1, 2023
1 parent 96fca9e commit 83f41e0
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/stores/widgetManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,9 @@ export const useWidgetManagerStore = defineStore('widget-manager', () => {

const index = currentProfile.value.views.indexOf(view)
currentProfile.value.views.splice(index, 1)
if (index === currentViewIndex.value) {
currentViewIndex.value = 0
}
}

/**
Expand Down

0 comments on commit 83f41e0

Please sign in to comment.