Skip to content
Snippets Groups Projects
Unverified Commit 2627dc2a authored by Thomas Citharel's avatar Thomas Citharel
Browse files

Fixup for find_polls with empty localstorage


Signed-off-by: default avatarThomas Citharel <tcit@tcit.fr>
parent 1a3081b5
No related branches found
No related tags found
No related merge requests found
......@@ -130,8 +130,18 @@
};
},
created() {
this.polls = JSON.parse(localStorage.getItem('polls'));
this.adminPolls = JSON.parse(localStorage.getItem('admin_polls'));
var polls = localStorage.getItem('polls');
if (polls === null) {
this.polls = [];
} else {
this.polls = JSON.parse(polls);
}
var adminPolls = localStorage.getItem('admin_polls');
if (adminPolls === null) {
this.adminPolls = [];
} else {
this.adminPolls = JSON.parse(adminPolls);
}
},
filters: {
date: function(value) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment