Use device storage for allowed widgets if account data not supported

With guest accounts, account data is not available, so we use device storage to
hold allowed widgets as a good enough place.

Fixes https://github.com/vector-im/element-web/issues/16145
This commit is contained in:
J. Ryan Stinnett 2021-01-14 17:30:25 +00:00
parent cb66f7493b
commit 658a8dfa99
4 changed files with 31 additions and 3 deletions

View file

@ -240,7 +240,8 @@ export default class AppTile extends React.Component {
console.info("Granting permission for widget to load: " + this.props.app.eventId);
const current = SettingsStore.getValue("allowedWidgets", roomId);
current[this.props.app.eventId] = true;
SettingsStore.setValue("allowedWidgets", roomId, SettingLevel.ROOM_ACCOUNT, current).then(() => {
const level = SettingsStore.firstSupportedLevel("allowedWidgets");
SettingsStore.setValue("allowedWidgets", roomId, level, current).then(() => {
this.setState({hasPermissionToLoad: true});
// Fetch a token for the integration manager, now that we're allowed to