Use WidgetType more often to avoid breaking new sticker pickers
Turns out that setUserWidget() wasn't updated to take a real WidgetType, but the code in ScalarMessaging thought it did. This leads to integration managers trying to add sticker widgets with an object `type` rather than a string `type`, which doesn't work. This updates other code paths which call into the various widget classes to use WidgetType more often. The actual code path for fixing widgets is resolved in WidgetUtils for the setUserWidget function body.
This commit is contained in:
parent
02ed921d57
commit
f54e99c708
4 changed files with 15 additions and 13 deletions
|
@ -210,9 +210,9 @@ export default class WidgetUtils {
|
|||
});
|
||||
}
|
||||
|
||||
static setUserWidget(widgetId, widgetType, widgetUrl, widgetName, widgetData) {
|
||||
static setUserWidget(widgetId, widgetType: WidgetType, widgetUrl, widgetName, widgetData) {
|
||||
const content = {
|
||||
type: widgetType,
|
||||
type: widgetType.preferred,
|
||||
url: widgetUrl,
|
||||
name: widgetName,
|
||||
data: widgetData,
|
||||
|
@ -369,7 +369,7 @@ export default class WidgetUtils {
|
|||
static addIntegrationManagerWidget(name: string, uiUrl: string, apiUrl: string) {
|
||||
return WidgetUtils.setUserWidget(
|
||||
"integration_manager_" + (new Date().getTime()),
|
||||
"m.integration_manager",
|
||||
WidgetType.INTEGRATION_MANAGER,
|
||||
uiUrl,
|
||||
"Integration Manager: " + name,
|
||||
{"api_url": apiUrl},
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue