Issue Title Show Focus Check On Load

This commit is contained in:
Regis Boudinot 2017-04-20 14:20:19 +00:00 committed by Filipa Lacerda
parent 33a25e0fc6
commit 44c52fa3cd
1 changed files with 11 additions and 12 deletions

View File

@ -34,17 +34,6 @@ export default {
};
},
methods: {
fetch() {
this.poll.makeRequest();
Visibility.change(() => {
if (!Visibility.hidden()) {
this.poll.restart();
} else {
this.poll.stop();
}
});
},
renderResponse(res) {
const body = JSON.parse(res.body);
this.triggerAnimation(body);
@ -71,7 +60,17 @@ export default {
},
},
created() {
this.fetch();
if (!Visibility.hidden()) {
this.poll.makeRequest();
}
Visibility.change(() => {
if (!Visibility.hidden()) {
this.poll.restart();
} else {
this.poll.stop();
}
});
},
};
</script>