Skip to content

Commit e75b9fe

Browse files
authored
Add validation for visible list prop (#429)
* Add validation for visible list prop * Remove invalidated cookies
1 parent 0d93120 commit e75b9fe

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/components/Road.vue

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,11 @@ export default {
117117
mounted () {
118118
const visibleList = JSON.parse(this.$cookies.get('visibleList' + this.roadID));
119119
if (this.$store.state.cookiesAllowed && visibleList) {
120-
this.visibleList = visibleList;
120+
if (Array.isArray(visibleList) && visibleList.length == this.numSems) {
121+
this.visibleList = visibleList;
122+
} else {
123+
this.$cookies.remove('visibleList' + this.roadID);
124+
}
121125
};
122126
}
123127
};

0 commit comments

Comments
 (0)