Finish config conversion

This commit is contained in:
N-Pex 2025-07-07 11:23:11 +02:00
parent eb58f77162
commit 4e755ace36
2 changed files with 13 additions and 6 deletions

View file

@ -157,7 +157,7 @@ router.beforeEach((to, from, next) => {
let roomId = util.sanitizeUserId(to.params.userId);
if (roomId && !roomId.startsWith("@")) {
// Not a full username. Assume local name on this server.
return router.app.$config.promise.then((config) => {
return router.app.$config.load().then((config) => {
const domain = config.defaultMatrixDomainPart;
if (!domain) throw new Error("No domain part for user invite!");
roomId = "@" + roomId + ":" + domain;
@ -174,7 +174,7 @@ router.beforeEach((to, from, next) => {
router.app.$matrix.setCurrentRoomId(roomId);
}
} else if (to.name == 'CreateRoom') {
return router.app.$config.promise.then((config) => {
return router.app.$config.load().then((config) => {
if (config.hide_add_room_on_home || !config.roomTypes.includes("group_chat")) {
next('/');
} else {
@ -182,7 +182,7 @@ router.beforeEach((to, from, next) => {
}
}).catch(err => { console.error(err); next('/'); });
} else if (to.name == 'CreateChannel') {
return router.app.$config.promise.then((config) => {
return router.app.$config.load().then((config) => {
if (!config.roomTypes.includes("channel")) {
next('/');
} else {
@ -190,7 +190,7 @@ router.beforeEach((to, from, next) => {
}
}).catch(err => { console.error(err); next('/'); });
} else if (to.name == 'CreateFileDrop') {
return router.app.$config.promise.then((config) => {
return router.app.$config.load().then((config) => {
if (!config.roomTypes.includes("file_drop")) {
next('/');
} else {