Remove room creation option(s) if hide_add_room_on_home is set
This commit is contained in:
parent
b5678a04e4
commit
86d5f0c250
6 changed files with 22 additions and 6 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue