mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-17 22:57:21 +01:00
Added regsiter page and styles (#8836)
* Added regsiter page and styles * Added style updates * Added login server connection and logout * Added login * Added social auth * Moved image assests * Added trasnlations * Added social icons * Removed duplicate * Updated shrinkwrap
This commit is contained in:
@@ -36,33 +36,8 @@ if (authSettings) {
|
||||
}
|
||||
|
||||
export default new Vue({
|
||||
el: '#app',
|
||||
router,
|
||||
store: generateStore(),
|
||||
render: h => h(AppComponent),
|
||||
beforeCreate () {
|
||||
// Setup listener for title
|
||||
this.$store.watch(state => state.title, (title) => {
|
||||
document.title = title;
|
||||
});
|
||||
|
||||
// Mount the app when user and tasks are loaded
|
||||
const userDataWatcher = this.$store.watch(state => [state.user.data, state.tasks.data], ([user, tasks]) => {
|
||||
if (user && user._id && tasks && Array.isArray(tasks.habits)) {
|
||||
userDataWatcher(); // remove the watcher
|
||||
this.$mount('#app');
|
||||
}
|
||||
});
|
||||
|
||||
// Load the user and the user tasks
|
||||
Promise.all([
|
||||
this.$store.dispatch('user:fetch'),
|
||||
this.$store.dispatch('tasks:fetchUserTasks'),
|
||||
]).catch((err) => {
|
||||
console.error('Impossible to fetch user. Copy into localStorage a valid habit-mobile-settings object.', err); // eslint-disable-line no-console
|
||||
});
|
||||
},
|
||||
mounted () { // Remove the loading screen when the app is mounted
|
||||
let loadingScreen = document.getElementById('loading-screen');
|
||||
if (loadingScreen) document.body.removeChild(loadingScreen);
|
||||
},
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user