Remove room creation option(s) if hide_add_room_on_home is set

This commit is contained in:
N-Pex 2023-10-31 09:51:57 +01:00
parent b5678a04e4
commit 86d5f0c250
6 changed files with 22 additions and 6 deletions

View file

@ -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