From cb66f7493b24e860f0d7e850afe007eecc9046b7 Mon Sep 17 00:00:00 2001 From: "J. Ryan Stinnett" Date: Thu, 14 Jan 2021 15:58:26 +0000 Subject: [PATCH] Skip account settings for guest users Homeservers don't allow this currently, so we should use something else instead for such cases. --- src/settings/handlers/AccountSettingsHandler.ts | 2 +- src/settings/handlers/RoomAccountSettingsHandler.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/settings/handlers/AccountSettingsHandler.ts b/src/settings/handlers/AccountSettingsHandler.ts index d609fd3231..e75faa49c1 100644 --- a/src/settings/handlers/AccountSettingsHandler.ts +++ b/src/settings/handlers/AccountSettingsHandler.ts @@ -169,7 +169,7 @@ export default class AccountSettingsHandler extends MatrixClientBackedSettingsHa public isSupported(): boolean { const cli = MatrixClientPeg.get(); - return cli !== undefined && cli !== null; + return cli !== undefined && cli !== null && !cli.isGuest(); } private getSettings(eventType = "im.vector.web.settings"): any { // TODO: [TS] Types on return diff --git a/src/settings/handlers/RoomAccountSettingsHandler.ts b/src/settings/handlers/RoomAccountSettingsHandler.ts index 53e29653f8..416bdddb90 100644 --- a/src/settings/handlers/RoomAccountSettingsHandler.ts +++ b/src/settings/handlers/RoomAccountSettingsHandler.ts @@ -129,7 +129,7 @@ export default class RoomAccountSettingsHandler extends MatrixClientBackedSettin public isSupported(): boolean { const cli = MatrixClientPeg.get(); - return cli !== undefined && cli !== null; + return cli !== undefined && cli !== null && !cli.isGuest(); } private getSettings(roomId: string, eventType = "im.vector.web.settings"): any { // TODO: [TS] Type return