diff --git a/src/App.vue b/src/App.vue index 05e5b22..e174786 100644 --- a/src/App.vue +++ b/src/App.vue @@ -7,7 +7,7 @@ @@ -23,7 +23,7 @@ @@ -132,6 +132,9 @@ export default { }, }, computed: { + showLoadingScreen() { + return this.loading || !(this.$config.loaded); + }, notificationCount, currentUser() { return this.$store.state.auth.user; diff --git a/src/components/Login.vue b/src/components/Login.vue index e76c817..b8056c8 100644 --- a/src/components/Login.vue +++ b/src/components/Login.vue @@ -86,7 +86,7 @@ class="filled-button mt-4" >{{ $t("login.login") }} -
{{ $t("login.or") }}
+
{{ $t("login.or") }}
{{ $t("login.create_room") }} @@ -151,6 +151,9 @@ export default { showCloseButton() { return this.$navigation && this.$navigation.canPop(); }, + showCreateRoom() { + return this.showCreateRoomOption && !this.$config.hide_add_room_on_home; + } }, created() { if (this.loggedIn) { diff --git a/src/components/ProfileInfoPopup.vue b/src/components/ProfileInfoPopup.vue index f2ef536..ec86bf1 100644 --- a/src/components/ProfileInfoPopup.vue +++ b/src/components/ProfileInfoPopup.vue @@ -50,7 +50,7 @@ {{ productLink }} -
+
{{ $t("profile_info_popup.new_room") }} diff --git a/src/components/RoomInfoBottomSheet.vue b/src/components/RoomInfoBottomSheet.vue index c376e34..c5bc13e 100644 --- a/src/components/RoomInfoBottomSheet.vue +++ b/src/components/RoomInfoBottomSheet.vue @@ -6,7 +6,7 @@ :showCloseButton="false" >
- +
diff --git a/src/router/index.js b/src/router/index.js index 0e4a0a8..b70280b 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -145,6 +145,14 @@ router.beforeEach((to, from, next) => { const roomId = util.sanitizeRoomId(to.params.roomId); router.app.$matrix.setCurrentRoomId(roomId); } + } else if (to.name == 'CreateRoom') { + return router.app.$config.promise.then((config) => { + if (config.hide_add_room_on_home) { + next('/'); + } else { + next(); + } + }).catch(err => { console.error(err); next('/'); }); } // trying to access a restricted page + not logged in diff --git a/src/services/config.service.js b/src/services/config.service.js index 3a73259..08d5ddc 100644 --- a/src/services/config.service.js +++ b/src/services/config.service.js @@ -1,6 +1,7 @@ export default { install(Vue, defaultServerFromLocation, onloaded) { var config = Vue.observable(require('@/assets/config.json')); + Vue.set(config, "loaded", false); const getRuntimeConfig = () => { return fetch('./config.json?ms=' + Date.now()).then((res) => res.json()).catch(err => { console.error("Failed to get config:", err); @@ -17,6 +18,7 @@ export default { if (!json.defaultServer) { Vue.set(config, "defaultServer", defaultServerFromLocation); } + Vue.set(config, "loaded", true); // Tell callback we are done loading runtime config if (onloaded) {