Skip to content

Commit

Permalink
* Prevent ghost of modal from displaying when navigating away from Fi…
Browse files Browse the repository at this point in the history
…nd VIN page.
  • Loading branch information
TheSeg committed Jan 4, 2021
1 parent ae87595 commit d602dab
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions src/components/03_Data.vue
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,16 @@ export default {
data () {
return {
textData: null,
errors: false
errors: false,
myModal: null
}
},
mounted () {
this.myModal = new Modal(document.getElementById('finalDataModal'))
},
beforeUnmount () {
this.myModal.hide()
},
methods: {
processJSON (event) {
this.errors = false
Expand All @@ -42,8 +49,7 @@ export default {
if (processed) {
this.$store.commit('updateMainData', processed)
if (this.$store.state.foundVINS.length > 0) {
const myModal = new Modal(document.getElementById('finalDataModal'))
myModal.show()
this.myModal.show()
} else {
this.errors = 'While proper JSON, it doesn\t look like this data has a VIN number.'
}
Expand Down

0 comments on commit d602dab

Please sign in to comment.