mirror of
https://github.com/cinnyapp/cinny.git
synced 2025-11-05 06:50:28 +03:00
Accept mxid on login (#187)
This commit is contained in:
parent
3dda4d6540
commit
4427b3b291
3 changed files with 33 additions and 31 deletions
|
|
@ -20,7 +20,7 @@ export async function getBaseUrl(servername) {
|
|||
if (baseUrl === undefined) throw new Error();
|
||||
return baseUrl;
|
||||
} catch (e) {
|
||||
throw new Error(`${protocol}${servername}`);
|
||||
return `${protocol}${servername}`;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -204,11 +204,10 @@ export async function hasDevices(userId) {
|
|||
const mx = initMatrix.matrixClient;
|
||||
try {
|
||||
const usersDeviceMap = await mx.downloadKeys([userId, mx.getUserId()]);
|
||||
return Object.values(usersDeviceMap).every((userDevices) =>
|
||||
Object.keys(userDevices).length > 0,
|
||||
);
|
||||
return Object.values(usersDeviceMap)
|
||||
.every((userDevices) => (Object.keys(userDevices).length > 0));
|
||||
} catch (e) {
|
||||
console.error("Error determining if it's possible to encrypt to all users: ", e);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue