mirror of
https://github.com/element-hq/element-web
synced 2024-11-28 04:21:57 +03:00
Merge pull request #1894 from turt2live/travis/fix-stickerpacks
Correctly identify sticker picker widgets
This commit is contained in:
commit
8c3a63a169
1 changed files with 2 additions and 3 deletions
|
@ -58,8 +58,7 @@ function getUserWidgetsArray() {
|
||||||
*/
|
*/
|
||||||
function getStickerpickerWidgets() {
|
function getStickerpickerWidgets() {
|
||||||
const widgets = getUserWidgetsArray();
|
const widgets = getUserWidgetsArray();
|
||||||
const stickerpickerWidgets = widgets.filter((widget) => widget.type='m.stickerpicker');
|
return widgets.filter((widget) => widget.content && widget.content.type === "m.stickerpicker");
|
||||||
return stickerpickerWidgets;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -73,7 +72,7 @@ function removeStickerpickerWidgets() {
|
||||||
}
|
}
|
||||||
const userWidgets = client.getAccountData('m.widgets').getContent() || {};
|
const userWidgets = client.getAccountData('m.widgets').getContent() || {};
|
||||||
Object.entries(userWidgets).forEach(([key, widget]) => {
|
Object.entries(userWidgets).forEach(([key, widget]) => {
|
||||||
if (widget.type === 'm.stickerpicker') {
|
if (widget.content && widget.content.type === 'm.stickerpicker') {
|
||||||
delete userWidgets[key];
|
delete userWidgets[key];
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in a new issue