Skip to content

Commit

Permalink
fix(products): unset product when unmounting shell (#453)
Browse files Browse the repository at this point in the history
  • Loading branch information
davidma415 authored Mar 4, 2024
1 parent d783b97 commit be0f312
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/views/ProductShell.vue
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
</template>

<script lang="ts" setup>
import { computed, onMounted, ref, watch, watchEffect } from 'vue'
import { computed, onMounted, onUnmounted, ref, watch, watchEffect } from 'vue'
import { useRoute, useRouter } from 'vue-router'
import { storeToRefs } from 'pinia'
import getMessageFromError from '@/helpers/getMessageFromError'
Expand Down Expand Up @@ -213,6 +213,10 @@ onMounted(async () => {
initActiveProductVersionId()
})
onUnmounted(() => {
productStore.setProduct(null)
})
watch(() => productVersionParam.value, () => {
if (productVersionParam.value && (productVersionParam.value !== activeProductVersionId.value)) {
productStore.setActiveProductVersionId(productVersionParam.value)
Expand Down

0 comments on commit be0f312

Please sign in to comment.