Merge branch '532-failed-to-join-room-from-dm-link' into 'dev'
Wait until config is loaded before using values See merge request keanuapp/keanuapp-weblite!246
This commit is contained in:
commit
08d30e66f6
1 changed files with 9 additions and 5 deletions
|
|
@ -129,12 +129,16 @@ router.beforeEach((to, from, next) => {
|
||||||
let roomId = util.sanitizeUserId(to.params.userId);
|
let roomId = util.sanitizeUserId(to.params.userId);
|
||||||
if (roomId && !roomId.startsWith("@")) {
|
if (roomId && !roomId.startsWith("@")) {
|
||||||
// Not a full username. Assume local name on this server.
|
// Not a full username. Assume local name on this server.
|
||||||
const user = new User(router.app.$config.defaultServer, roomId, "");
|
return router.app.$config.promise.then((config) => {
|
||||||
user.normalize();
|
const user = new User(config.defaultServer, roomId, "");
|
||||||
roomId = "@" + roomId + ":" + User.serverDomain(user.home_server);
|
user.normalize();
|
||||||
|
roomId = "@" + roomId + ":" + User.serverDomain(user.home_server);
|
||||||
|
router.app.$matrix.setCurrentRoomId(roomId);
|
||||||
|
}).catch(err => console.error(err)).finally(() => next());
|
||||||
|
} else {
|
||||||
|
router.app.$matrix.setCurrentRoomId(roomId);
|
||||||
|
authRequired = false;
|
||||||
}
|
}
|
||||||
router.app.$matrix.setCurrentRoomId(roomId);
|
|
||||||
authRequired = false;
|
|
||||||
}
|
}
|
||||||
} else if (to.name == 'Invite') {
|
} else if (to.name == 'Invite') {
|
||||||
if (to.params.roomId) {
|
if (to.params.roomId) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue