Construct modal widgets in the same way we do any other widget

Fixes https://github.com/vector-im/element-web/issues/15800
This commit is contained in:
Travis Ralston 2020-11-25 18:51:27 -07:00
parent 51f6205258
commit fc820c4b1a
2 changed files with 3 additions and 2 deletions

View file

@ -38,6 +38,7 @@ import {MatrixClientPeg} from "../../../MatrixClientPeg";
import RoomViewStore from "../../../stores/RoomViewStore";
import {OwnProfileStore} from "../../../stores/OwnProfileStore";
import { arrayFastClone } from "../../../utils/arrays";
import { ElementWidget } from "../../../stores/widgets/StopGapWidget";
interface IProps {
widgetDefinition: IModalWidgetOpenRequestData;
@ -64,7 +65,7 @@ export default class ModalWidgetDialog extends React.PureComponent<IProps, IStat
constructor(props) {
super(props);
this.widget = new Widget({
this.widget = new ElementWidget({
...this.props.widgetDefinition,
creatorUserId: MatrixClientPeg.get().getUserId(),
id: `modal_${this.props.sourceWidgetId}`,

View file

@ -68,7 +68,7 @@ interface IAppTileProps {
}
// TODO: Don't use this because it's wrong
class ElementWidget extends Widget {
export class ElementWidget extends Widget {
constructor(private rawDefinition: IWidget) {
super(rawDefinition);
}