Skip to content
This repository was archived by the owner on Sep 11, 2024. It is now read-only.

Commit 838bbde

Browse files
authored
Merge pull request #5608 from matrix-org/jryans/tally-ho-release
[Release] Lock widget room ID when added
2 parents 6acd802 + ad2a187 commit 838bbde

File tree

5 files changed

+14
-9
lines changed

5 files changed

+14
-9
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@
8181
"linkifyjs": "^2.1.9",
8282
"lodash": "^4.17.20",
8383
"matrix-js-sdk": "9.6.0-rc.1",
84-
"matrix-widget-api": "^0.1.0-beta.12",
84+
"matrix-widget-api": "^0.1.0-beta.13",
8585
"minimist": "^1.2.5",
8686
"pako": "^2.0.3",
8787
"parse5": "^6.0.1",

src/components/views/dialogs/ModalWidgetDialog.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,13 +35,13 @@ import {
3535
} from "matrix-widget-api";
3636
import {StopGapWidgetDriver} from "../../../stores/widgets/StopGapWidgetDriver";
3737
import {MatrixClientPeg} from "../../../MatrixClientPeg";
38-
import RoomViewStore from "../../../stores/RoomViewStore";
3938
import {OwnProfileStore} from "../../../stores/OwnProfileStore";
4039
import { arrayFastClone } from "../../../utils/arrays";
4140
import { ElementWidget } from "../../../stores/widgets/StopGapWidget";
4241

4342
interface IProps {
4443
widgetDefinition: IModalWidgetOpenRequestData;
44+
widgetRoomId?: string;
4545
sourceWidgetId: string;
4646
onFinished(success: boolean, data?: IModalWidgetReturnData): void;
4747
}
@@ -123,7 +123,7 @@ export default class ModalWidgetDialog extends React.PureComponent<IProps, IStat
123123

124124
public render() {
125125
const templated = this.widget.getCompleteUrl({
126-
currentRoomId: RoomViewStore.getRoomId(),
126+
widgetRoomId: this.props.widgetRoomId,
127127
currentUserId: MatrixClientPeg.get().getUserId(),
128128
userDisplayName: OwnProfileStore.instance.displayName,
129129
userHttpAvatarUrl: OwnProfileStore.instance.getHttpAvatarUrl(),

src/stores/ModalWidgetStore.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,11 +48,16 @@ export class ModalWidgetStore extends AsyncStoreWithClient<IState> {
4848
return !this.modalInstance;
4949
};
5050

51-
public openModalWidget = (requestData: IModalWidgetOpenRequestData, sourceWidget: Widget) => {
51+
public openModalWidget = (
52+
requestData: IModalWidgetOpenRequestData,
53+
sourceWidget: Widget,
54+
widgetRoomId?: string,
55+
) => {
5256
if (this.modalInstance) return;
5357
this.openSourceWidgetId = sourceWidget.id;
5458
this.modalInstance = Modal.createTrackedDialog('Modal Widget', '', ModalWidgetDialog, {
5559
widgetDefinition: {...requestData},
60+
widgetRoomId,
5661
sourceWidgetId: sourceWidget.id,
5762
onFinished: (success: boolean, data?: IModalWidgetReturnData) => {
5863
if (!success) {

src/stores/widgets/StopGapWidget.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ export class StopGapWidget extends EventEmitter {
190190

191191
private runUrlTemplate(opts = {asPopout: false}): string {
192192
const templated = this.mockWidget.getCompleteUrl({
193-
currentRoomId: RoomViewStore.getRoomId(),
193+
widgetRoomId: this.roomId,
194194
currentUserId: MatrixClientPeg.get().getUserId(),
195195
userDisplayName: OwnProfileStore.instance.displayName,
196196
userHttpAvatarUrl: OwnProfileStore.instance.getHttpAvatarUrl(),

yarn.lock

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5605,10 +5605,10 @@ matrix-react-test-utils@^0.2.2:
56055605
resolved "https://registry.yarnpkg.com/matrix-react-test-utils/-/matrix-react-test-utils-0.2.2.tgz#c87144d3b910c7edc544a6699d13c7c2bf02f853"
56065606
integrity sha512-49+7gfV6smvBIVbeloql+37IeWMTD+fiywalwCqk8Dnz53zAFjKSltB3rmWHso1uecLtQEcPtCijfhzcLXAxTQ==
56075607

5608-
matrix-widget-api@^0.1.0-beta.12:
5609-
version "0.1.0-beta.12"
5610-
resolved "https://registry.yarnpkg.com/matrix-widget-api/-/matrix-widget-api-0.1.0-beta.12.tgz#6cadeabde14f02949b7c3177434a4755942559b8"
5611-
integrity sha512-43xVAzLYzddYF73r6NK7NZ3geDLshQqCNAAcv0t5LFyFkKYGWDQG/cg8Vn8d37wm9WVBqYZUOXy9vBD4JcWVPA==
5608+
matrix-widget-api@^0.1.0-beta.13:
5609+
version "0.1.0-beta.13"
5610+
resolved "https://registry.yarnpkg.com/matrix-widget-api/-/matrix-widget-api-0.1.0-beta.13.tgz#ebddc83eaef39bbb87b621a02a35902e1a29b9ef"
5611+
integrity sha512-DJAvuX2E7gxc/a9rtJPDh17ba9xGIOAoBHcWirNTN3KGodzsrZ+Ns+M/BREFWMwGS5yEBZko5eq7uhXStEbnyQ==
56125612
dependencies:
56135613
"@types/events" "^3.0.0"
56145614
events "^3.2.0"

0 commit comments

Comments
 (0)