1
0
mirror of https://github.com/matrix-org/matrix-react-sdk.git synced 2025-11-07 10:46:24 +03:00

Use getUserWidgets where possible.

This commit is contained in:
Richard Lewis
2018-03-09 09:15:16 +00:00
parent e7c19fd83b
commit a33859326e
2 changed files with 16 additions and 9 deletions

View File

@@ -335,10 +335,7 @@ function setWidget(event, roomId) {
if (userWidget) {
const client = MatrixClientPeg.get();
let userWidgets = {};
if (client.getAccountData('m.widgets')) {
userWidgets = client.getAccountData('m.widgets').getContent();
}
const userWidgets = Widgets.getUserWidgets();
// Delete existing widget with ID
try {
@@ -408,7 +405,7 @@ function getWidgets(event, roomId) {
}
// Add user widgets (not linked to a specific room)
const userWidgets = Widgets.getUserWidgets();
const userWidgets = Widgets.getUserWidgetsArray();
widgetStateEvents = widgetStateEvents.concat(userWidgets);
sendResponse(event, widgetStateEvents);