user: do like project on route changes

This commit is contained in:
Simone Gotti 2019-03-29 18:21:57 +01:00
parent 219b2d2e2f
commit 6e8cd885aa
1 changed files with 6 additions and 9 deletions

View File

@ -78,15 +78,12 @@ export default {
run: null
};
},
async beforeRouteEnter(to, from, next) {
if (!to.params.runid) next();
let run = await fetchRun(to.params.runid);
next(vm => (vm.run = run));
},
async beforeRouteUpdate(to, from, next) {
if (!to.params.runid) next();
this.run = await fetchRun(to.params.runid);
next();
watch: {
$route: async function(route) {
if (route.params.runid) {
this.run = await fetchRun(route.params.runid);
}
}
},
methods: {
ownerLink: ownerLink,