Fix: Todo Multi refresh ...

fix some promises problem
This commit is contained in:
Paolo Arena
2019-02-14 18:38:23 +01:00
parent e8d2d49829
commit 6931d57005
22 changed files with 281 additions and 163 deletions

View File

@@ -12,7 +12,6 @@ import globalroutines from './globalroutines/index'
import { GlobalStore } from './store/Modules'
@Component({
components: {
appHeader: Header
@@ -25,6 +24,7 @@ export default class App extends Vue {
public backgroundColor = 'whitesmoke'
public $q
public listaRoutingNoLogin = ['/vreg?', '/offline']
created() {
if (process.env.DEV) {
@@ -36,16 +36,30 @@ export default class App extends Vue {
// console.info(process.env)
}
UserStore.actions.autologin_FromLocalStorage()
.then((loadstorage) => {
if (loadstorage) {
globalroutines(this, 'loadapp', '')
// this.$router.replace('/')
// Make autologin only if some routing
// console.log('window.location.href', window.location.href)
let chiamaautologin = true
this.listaRoutingNoLogin.forEach(mystr => {
if (window.location.href.includes(mystr)) {
chiamaautologin = false
}
})
if (chiamaautologin) {
console.log('CHIAMA autologin_FromLocalStorage')
UserStore.actions.autologin_FromLocalStorage()
.then((loadstorage) => {
if (loadstorage) {
globalroutines(this, 'loadapp', '')
// this.$router.replace('/')
// Create Subscription to Push Notification
GlobalStore.actions.createPushSubscription()
}
})
GlobalStore.actions.createPushSubscription()
}
})
}
// Calling the Server for updates ?
// Check the verified_email
@@ -53,5 +67,4 @@ export default class App extends Vue {
}
}