Fix: Todo Multi refresh ...
fix some promises problem
This commit is contained in:
33
src/App.ts
33
src/App.ts
@@ -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 {
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user