Skip to content

Commit

Permalink
Remove draftId when navigating away from Draft Corrections (#1903)
Browse files Browse the repository at this point in the history
  • Loading branch information
dimak1 authored May 29, 2024
1 parent 3055262 commit 86c731e
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 6 deletions.
4 changes: 2 additions & 2 deletions ppr-ui/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion ppr-ui/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ppr-ui",
"version": "3.2.1",
"version": "3.2.2",
"private": true,
"appName": "Assets UI",
"sbcName": "SBC Common Components",
Expand Down
14 changes: 11 additions & 3 deletions ppr-ui/src/views/newMhrRegistration/MhrRegistration.vue
Original file line number Diff line number Diff line change
Expand Up @@ -111,10 +111,10 @@
</template>

<script lang="ts">
import { computed, defineComponent, nextTick, onMounted, reactive, toRefs } from 'vue'
import { computed, defineComponent, nextTick, onBeforeUnmount, onMounted, reactive, toRefs } from 'vue'
import { useStore } from '@/store/store'
import { storeToRefs } from 'pinia'
import { ErrorCategories, RegistrationFlowType, RouteNames, UIRegistrationTypes } from '@/enums'
import { APIMhrTypes, ErrorCategories, RegistrationFlowType, RouteNames, UIRegistrationTypes } from '@/enums'
import { getFeatureFlag, getMhrDraft, submitAdminRegistration, submitMhrRegistration } from '@/utils'
import { ButtonFooter, Stepper, StickyContainer } from '@/components/common'
import {
Expand Down Expand Up @@ -158,7 +158,8 @@ export default defineComponent({
setUnsavedChanges,
setRegTableNewItem,
setMhrTransferType,
setDraft
setDraft,
setMhrInformationDraftId
} = useStore()
const {
// Getters
Expand Down Expand Up @@ -264,6 +265,13 @@ export default defineComponent({
localState.dataLoaded = true
})
onBeforeUnmount(async () => {
// fixes the issue when user is navigated from Draft Corrections to MHR Info page
if (getMhrInformation.value?.registrationType === APIMhrTypes.REGISTRY_STAFF_ADMIN) {
await setMhrInformationDraftId('')
}
})
const submit = async () => {
// Prompt App Validations
await setValidation(MhrSectVal.REVIEW_CONFIRM_VALID, MhrCompVal.VALIDATE_APP, true)
Expand Down

0 comments on commit 86c731e

Please sign in to comment.