Skip to content

Commit

Permalink
fix(route): wrong compare variables
Browse files Browse the repository at this point in the history
crsten committed Mar 31, 2020

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
1 parent d8d5708 commit d2b8cbc
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/states/route.js
Original file line number Diff line number Diff line change
@@ -9,9 +9,9 @@ class StateHandler {
}

set(id = this.get()) {
this.cp.active = this.cp.value.find(v => v.id === id)
this.cp.active = this.cp.value.find((v) => v.id === id)

if (this.get() !== id)
if (this.cp.$route.params[this.cp.stateKey] !== id)
this.cp.$router.push({
name: this.cp.$route.name,
params: {
@@ -24,7 +24,7 @@ class StateHandler {
initialize() {
this.unwatchState = this.cp.$watch(
`$route.params.${this.cp.stateKey}`,
value => this.set(value),
(value) => this.set(value),
{
immediate: true,
},

0 comments on commit d2b8cbc

Please sign in to comment.