don't fail login if dehydrated devices are not supported

This commit is contained in:
Bruno Windels 2021-11-25 15:38:13 +01:00
parent 93abbe83e8
commit 229c584138

View file

@ -329,7 +329,16 @@ export class SessionContainer {
request: this._platform.request, request: this._platform.request,
}); });
const olm = await this._olmPromise; const olm = await this._olmPromise;
const encryptedDehydratedDevice = await getDehydratedDevice(hsApi, olm, this._platform, log); let encryptedDehydratedDevice;
try {
encryptedDehydratedDevice = await getDehydratedDevice(hsApi, olm, this._platform, log);
} catch (err) {
if (err instanceof HomeServerError) {
log.set("not_supported", true);
} else {
throw err;
}
}
if (encryptedDehydratedDevice) { if (encryptedDehydratedDevice) {
let resolveStageFinish; let resolveStageFinish;
const promiseStageFinish = new Promise(r => resolveStageFinish = r); const promiseStageFinish = new Promise(r => resolveStageFinish = r);