1
0
mirror of https://github.com/matrix-org/matrix-react-sdk.git synced 2025-11-04 11:51:45 +03:00

Fix widgets for all other sources too

This commit is contained in:
Travis Ralston
2020-04-09 15:25:11 -06:00
parent dc92f557fd
commit 4510499987
3 changed files with 18 additions and 2 deletions

View File

@@ -35,6 +35,7 @@ import { abbreviateUrl } from './utils/UrlUtils';
import { getDefaultIdentityServerUrl, useDefaultIdentityServer } from './utils/IdentityServerUtils';
import {isPermalinkHost, parsePermalink} from "./utils/permalinks/Permalinks";
import {inviteUsersToRoom} from "./RoomInvite";
import { WidgetType } from "./widgets/WidgetType";
// XXX: workaround for https://github.com/microsoft/TypeScript/issues/31816
interface HTMLInputEvent extends Event {
@@ -775,7 +776,7 @@ export const Commands = [
const nowMs = (new Date()).getTime();
const widgetId = encodeURIComponent(`${roomId}_${userId}_${nowMs}`);
return success(WidgetUtils.setRoomWidget(
roomId, widgetId, "m.custom", args, "Custom Widget", {}));
roomId, widgetId, WidgetType.CUSTOM, args, "Custom Widget", {}));
} else {
return reject(_t("You cannot modify widgets in this room."));
}