You've already forked matrix-react-sdk
mirror of
https://github.com/matrix-org/matrix-react-sdk.git
synced 2025-11-20 16:22:28 +03:00
Check for empty user widgets.
This commit is contained in:
@@ -87,7 +87,6 @@ export default class Stickerpack extends React.Component {
|
|||||||
this._getStickerPickerWidget();
|
this._getStickerPickerWidget();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
console.error("Unhandled widget action");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
_getStickerPickerWidget() {
|
_getStickerPickerWidget() {
|
||||||
|
|||||||
@@ -36,8 +36,12 @@ function getUserWidgets() {
|
|||||||
if (!client) {
|
if (!client) {
|
||||||
throw new Error('User not logged in');
|
throw new Error('User not logged in');
|
||||||
}
|
}
|
||||||
const userWidgets = client.getAccountData('m.widgets').getContent() || {};
|
const userWidgets = client.getAccountData('m.widgets');
|
||||||
return Object.keys(userWidgets).map((key) => userWidgets[key]);
|
let userWidgetContent = {};
|
||||||
|
if (userWidgets && userWidgets.getContent()) {
|
||||||
|
userWidgetContent = userWidgets.getContent();
|
||||||
|
}
|
||||||
|
return Object.keys(userWidgetContent).map((key) => userWidgetContent[key]);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user