Skip to content

Commit

Permalink
refactor: ♻️ refactor typologies files
Browse files Browse the repository at this point in the history
  • Loading branch information
nutfdt committed May 28, 2024
1 parent f8984d4 commit 22e054d
Showing 1 changed file with 6 additions and 9 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<script lang="ts" setup>
import { computed, ref } from 'vue'
import { computed } from 'vue'
import { useRouter } from 'vue-router'
import { useStepsStore } from '@/stores/steps'
Expand All @@ -25,26 +25,23 @@ const selectedOptionStep = computed(() => {
return stepsStore.currentOptionStep['1']
})
const options = TYPOLOGIES.revolver?.securingSteps?.steps[1]?.options.concat(TYPOLOGIES.revolver?.securingSteps?.steps[2]?.options)
const matchingOption = options.find(option => option.value.toString() === selectedOptionStep.value.toString())
const selectedOptionVideos = computed(() => {
const optionsStep1 = TYPOLOGIES.revolver?.securingSteps?.steps[1]?.options
const options = optionsStep1.concat(TYPOLOGIES.revolver?.securingSteps?.steps[2]?.options)
let selectedOptionVideo = ''
if (optionsStep1 && selectedOptionStep.value) {
const matchingOption = options.find(option => option.value.toString() === selectedOptionStep.value.toString())
if (options && selectedOptionStep.value) {
selectedOptionVideo = matchingOption ? matchingOption.video : ''
}
return selectedOptionVideo
})
const selectedOptionTexts = computed(() => {
const optionsStep1 = TYPOLOGIES.revolver?.securingSteps?.steps[1]?.options
const options = optionsStep1.concat(TYPOLOGIES.revolver?.securingSteps?.steps[2]?.options)
let selectedOptionText = ''
if (optionsStep1 && selectedOptionStep.value) {
const matchingOption = options.find(option => option.value.toString() === selectedOptionStep.value.toString())
if (options && selectedOptionStep.value) {
selectedOptionText = matchingOption ? matchingOption.text_steps : ''
}
Expand Down

0 comments on commit 22e054d

Please sign in to comment.