mirror of https://github.com/vector-im/riot-web
Merge pull request #3336 from matrix-org/travis/fix-removing-widgets
No-op removals of widgets that don't existpull/21833/head
commit
e9b44c9802
|
@ -354,7 +354,9 @@ export default class WidgetUtils {
|
|||
if (!client) {
|
||||
throw new Error('User not logged in');
|
||||
}
|
||||
const userWidgets = client.getAccountData('m.widgets').getContent() || {};
|
||||
const widgets = client.getAccountData('m.widgets');
|
||||
if (!widgets) return;
|
||||
const userWidgets = widgets.getContent() || {};
|
||||
Object.entries(userWidgets).forEach(([key, widget]) => {
|
||||
if (widget.content && widget.content.type === "m.integration_manager") {
|
||||
delete userWidgets[key];
|
||||
|
@ -382,7 +384,9 @@ export default class WidgetUtils {
|
|||
if (!client) {
|
||||
throw new Error('User not logged in');
|
||||
}
|
||||
const userWidgets = client.getAccountData('m.widgets').getContent() || {};
|
||||
const widgets = client.getAccountData('m.widgets');
|
||||
if (!widgets) return;
|
||||
const userWidgets = widgets.getContent() || {};
|
||||
Object.entries(userWidgets).forEach(([key, widget]) => {
|
||||
if (widget.content && widget.content.type === 'm.stickerpicker') {
|
||||
delete userWidgets[key];
|
||||
|
|
Loading…
Reference in New Issue