Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
onAuthStateChanged: data => { // optional
console.log((data.loggedIn ? "Logged in to firebase" : "Logged out from firebase") + " (init's onAuthStateChanged callback)");
if (data.loggedIn) {
backendService.token = data.user.uid
console.log(data.user.uid)
store.commit('setUser', data.user)
Vue.navigateTo(Home)
}
else {
backendService.token = ""
Vue.navigateTo(Login)
}
}
}).then(
onAuthStateChanged: data => { // optional
console.log((data.loggedIn ? "Logged in to firebase" : "Logged out from firebase") + " (init's onAuthStateChanged callback)");
if (data.loggedIn) {
backendService.token = data.user.uid
console.log(data.user.uid)
store.commit('setUser', data.user)
Vue.navigateTo(Home)
}
else {
backendService.token = ""
Vue.navigateTo(Login)
}
}
}).then(
Vue.prototype.$store = store;
Vue.prototype.$routes = routes;
Vue.prototype.$authService = authService
//route manually
Vue.prototype.$changeRoute = (to) => {
Vue.navigateTo(routes[to])
}
//TNSFontIcon.debug = true;
TNSFontIcon.paths = {
'fa': './font-awesome.css'
};
TNSFontIcon.loadCss();
Vue.filter('fonticon', fonticon)
Vue.use(Vuex)
firebase.init({
onAuthStateChanged: data => { // optional
console.log((data.loggedIn ? "Logged in to firebase" : "Logged out from firebase") + " (init's onAuthStateChanged callback)");
if (data.loggedIn) {
backendService.token = data.user.uid
console.log(data.user.uid)
store.commit('setUser', data.user)
Vue.navigateTo(Home)
}
else {
backendService.token = ""
Vue.navigateTo(Login)
import Vue from "nativescript-vue";
import router from "./router";
import store from "./store";
import "./styles.scss";
// Uncommment the following to see NativeScript-Vue output logs
Vue.config.silent = false;
console.log(store.state);
store.dispatch("auth/init").then(user => {
if (user) {
router.replace("home");
} else {
router.replace("login");
}
});
new Vue({
router,
store,
template: `
TNSPusherBeams.addDeviceInterest('debug-hello');
TNSPusherBeams.addDeviceInterest('hello');
console.log(TNSPusherBeams.getDeviceInterests());
TNSPusherBeams.clearDeviceInterests();
setTimeout(() => {
TNSPusherBeams.addDeviceInterest('debug-hello');
TNSPusherBeams.addDeviceInterest('hello');
TNSPusherBeams.addDeviceInterest('osei');
}, 5000);
// TNSPusherBeams.addOnMessageReceivedCallback(message => {
// console.log('message', message);
// });
});
// Prints Vue logs when --env.production is *NOT* set while building
Vue.config.silent = TNS_ENV === 'production';
new Vue({
render: h => h('frame', [h(App)])
}).$start();
<button>
`,
methods: {
openWizard() {
// show the wizard in a modal, and make sure it is fullscreen.
this.$showModal(WizardModal, {
fullscreen: true
}).then(res => {
console.log('wizard completed with res', res)
})
}
}
}
new Vue({
components: {
TabContent
},
template: `
</button>
console.log(TNSPusherBeams.getDeviceInterests());
TNSPusherBeams.clearDeviceInterests();
setTimeout(() => {
TNSPusherBeams.addDeviceInterest('debug-hello');
TNSPusherBeams.addDeviceInterest('hello');
TNSPusherBeams.addDeviceInterest('osei');
}, 5000);
// TNSPusherBeams.addOnMessageReceivedCallback(message => {
// console.log('message', message);
// });
});
// Prints Vue logs when --env.production is *NOT* set while building
Vue.config.silent = TNS_ENV === 'production';
new Vue({
render: h => h('frame', [h(App)])
}).$start();
import "./styles.scss";
// Uncommment the following to see NativeScript-Vue output logs
Vue.config.silent = false;
console.log(store.state);
store.dispatch("auth/init").then(user => {
if (user) {
router.replace("home");
} else {
router.replace("login");
}
});
new Vue({
router,
store,
template: `
`
}).$start();
}
}).then(
instance => {
console.log("firebase.init done");
},
error => {
console.log(`firebase.init error: ${error}`);
}
);
import './styles.scss';
// Uncommment the following to see NativeScript-Vue output logs
Vue.config.silent = false;
new Vue({
routes,
store,
render: h => h(backendService.isLoggedIn() ? Vue.navigateTo(Home) : Vue.navigateTo(Login)),
mounted() {
// force first redirect
/*if (backendService.isLoggedIn()) {
router.push('/home')
}
else {
router.push('/login')
}*/
import AuthService from './services/AuthService'
import { TNSFontIcon, fonticon } from 'nativescript-fonticon'
import Home from './components/Home'
import Login from './components/Login'
//import { setStatusBarColors } from './utils/statusBar'
const backendService = new BackendService()
const authService = new AuthService()
const store = new Vuex.Store(storeConf)
Vue.prototype.$store = store;
Vue.prototype.$routes = routes;
Vue.prototype.$authService = authService
//route manually
Vue.prototype.$changeRoute = (to) => {
Vue.navigateTo(routes[to])
}
//TNSFontIcon.debug = true;
TNSFontIcon.paths = {
'fa': './font-awesome.css'
};
TNSFontIcon.loadCss();
Vue.filter('fonticon', fonticon)
Vue.use(Vuex)
firebase.init({
onAuthStateChanged: data => { // optional