Add top level loading page

Issue #152.
This commit is contained in:
N-Pex 2021-07-18 11:48:40 +02:00
parent cf634ae483
commit f2f630083a
2 changed files with 37 additions and 1 deletions

View file

@ -2,6 +2,28 @@
<v-app> <v-app>
<v-main> <v-main>
<router-view /> <router-view />
<!-- Loading indicator -->
<v-container
fluid
fill-height
style="
position: absolute;
z-index: 20;
background-color: rgba(255, 255, 255, 1);
"
v-if="loading"
>
<v-row align="center" justify="center">
<v-col class="text-center">
<v-progress-circular
indeterminate
color="primary"
></v-progress-circular>
<div>{{$t('menu.loading', {appName: appName})}}</div>
</v-col>
</v-row>
</v-container>
</v-main> </v-main>
</v-app> </v-app>
</template> </template>
@ -11,6 +33,11 @@ import config from "./assets/config";
export default { export default {
name: "App", name: "App",
data() {
return {
loading: true,
};
},
beforeMount() { beforeMount() {
// Set language // Set language
this.$i18n.locale = this.$store.state.language || "en"; this.$i18n.locale = this.$store.state.language || "en";
@ -32,13 +59,21 @@ export default {
}) })
.catch((error) => { .catch((error) => {
console.log("Error creating client", error); console.log("Error creating client", error);
})
.finally(() => {
this.loading = false;
}); });
} else {
this.loading = false;
} }
}, },
computed: { computed: {
currentUser() { currentUser() {
return this.$store.state.auth.user; return this.$store.state.auth.user;
}, },
appName() {
return config.appName;
},
title() { title() {
var title = this.$t(config.appName); var title = this.$t(config.appName);
if (this.$matrix.notificationCount > 0) { if (this.$matrix.notificationCount > 0) {

View file

@ -14,7 +14,8 @@
"login": "Login", "login": "Login",
"logout": "Logout", "logout": "Logout",
"new_room": "New Room", "new_room": "New Room",
"undo": "Undo" "undo": "Undo",
"loading": "Loading {appName}"
}, },
"message": { "message": {
"you": "You", "you": "You",