17 lines
360 B
JavaScript
17 lines
360 B
JavaScript
export default async function() {
|
|
const { store, redirect } = this.context
|
|
if (!store.state.engine.user) {
|
|
if (!await this.fetchUserInfo()) {
|
|
redirect('/')
|
|
}
|
|
}
|
|
if (this.isActive) {
|
|
console.warn('attempt to start already running engine!')
|
|
return
|
|
}
|
|
|
|
this.isActive = true
|
|
this.fetchUpdate()
|
|
console.debug('engine started')
|
|
}
|