Skip to content

Commit

Permalink
reset documents when requirements change (#405)
Browse files Browse the repository at this point in the history
  • Loading branch information
deetz99 authored Dec 18, 2024
1 parent a86ce13 commit 6d2bee0
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 7 deletions.
4 changes: 2 additions & 2 deletions strr-host-pm-web/app/pages/auth/account/choose-existing.vue
Original file line number Diff line number Diff line change
Expand Up @@ -137,8 +137,8 @@ function handleAccountSwitch (id: string) {
icon="i-mdi-chevron-right"
trailing
:block="isSmallScreen"
:to="$keycloak.tokenParsed.loginSource === LoginSource.BCSC
? localePath('/auth/account/create-new')
:to="$keycloak.tokenParsed.loginSource === LoginSource.BCSC
? localePath('/auth/account/create-new')
: useConnectNav().createAccountUrl()
"
:external="$keycloak.tokenParsed.loginSource !== LoginSource.BCSC"
Expand Down
14 changes: 10 additions & 4 deletions strr-host-pm-web/app/stores/document.ts
Original file line number Diff line number Diff line change
Expand Up @@ -315,10 +315,16 @@ export const useDocumentStore = defineStore('host/document', () => {
}
}

// TODO: stepper validation function

const $reset = () => {
storedDocuments.value = []
// reset documents when requirements change
watch([() => reqStore.propertyReqs, () => reqStore.prRequirements], async () => {
await $reset()
}, { deep: true })

async function $reset () {
const docsToDelete = [...storedDocuments.value]
for (const doc of docsToDelete) {
await removeStoredDocument(doc)
}
selectedDocType.value = undefined
}

Expand Down
2 changes: 1 addition & 1 deletion strr-host-pm-web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "strr-host-pm-web",
"private": true,
"type": "module",
"version": "0.0.12",
"version": "0.0.13",
"scripts": {
"build-check": "nuxt build",
"build": "nuxt generate",
Expand Down

0 comments on commit 6d2bee0

Please sign in to comment.