mirror of
https://github.com/vector-im/element-web.git
synced 2026-05-05 20:26:19 +02:00
Use widget type fromString
This commit is contained in:
parent
2b965a2741
commit
18be4cb202
@ -19,6 +19,7 @@ import { _t } from './languageHandler';
|
||||
import * as Roles from './Roles';
|
||||
import {isValid3pidInvite} from "./RoomInvite";
|
||||
import SettingsStore from "./settings/SettingsStore";
|
||||
import {WidgetType} from "./widgets/WidgetType";
|
||||
import {ALL_RULE_TYPES, ROOM_RULE_TYPES, SERVER_RULE_TYPES, USER_RULE_TYPES} from "./mjolnir/BanList";
|
||||
|
||||
function textForMemberEvent(ev) {
|
||||
@ -475,7 +476,10 @@ function textForWidgetEvent(event) {
|
||||
const {name: prevName, type: prevType, url: prevUrl} = event.getPrevContent();
|
||||
const {name, type, url} = event.getContent() || {};
|
||||
|
||||
if (type === 'jitsi' || prevType === 'jitsi') {
|
||||
const prevWidgetType = WidgetType.fromString(prevType);
|
||||
const widgetType = WidgetType.fromString(type);
|
||||
|
||||
if (widgetType === WidgetType.JITSI || prevWidgetType === WidgetType.JITSI) {
|
||||
return textForJitsiWidgetEvent(event, senderName, url, prevUrl);
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user