Skip to content

Commit

Permalink
Merge pull request #149 from silinternational/feature/reset-wizard-st…
Browse files Browse the repository at this point in the history
…eps-each-time

Reset the list of relevant steps each time so it is properly initialized
  • Loading branch information
forevermatt authored Mar 28, 2024
2 parents dfaff4c + 5e16cb8 commit daeb593
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions src/profile/steps.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,16 @@ const store = {
export default {
steps: store.steps,
async init() {
if (store.steps.length == 0) {
if (Vue.prototype.$user.auth_type == 'login') {
await Promise.all([retrieveMethods(), retrieveMfa()])
}

store.steps.push(...allSteps.filter(step => step.isRelevant(Vue.prototype.$user, recoveryMethods.alternates, mfa)))
store.steps.splice(0)

if (Vue.prototype.$user.auth_type == 'login') {
await Promise.all([retrieveMethods(), retrieveMfa()])
}

store.steps.push(...allSteps.filter(step => step.isRelevant(Vue.prototype.$user, recoveryMethods.alternates, mfa)))

for (let i = 0; i < store.steps.length; i++) {
Object.assign(store.steps[i], { id: i + 1, state: '' })
}
for (let i = 0; i < store.steps.length; i++) {
Object.assign(store.steps[i], { id: i + 1, state: '' })
}
},
forPath(path) {
Expand Down

0 comments on commit daeb593

Please sign in to comment.