Always send a request_id to Riot

Fixes https://github.com/turt2live/matrix-dimension/issues/241

Cherry picked from 17eb46e48d3bd40a76579735966eff3fd535e479
This commit is contained in:
Travis Ralston 2019-03-15 20:16:13 -06:00
parent 06ceecc05c
commit 005b471dc7

View File

@ -2,6 +2,7 @@ import { ScalarToWidgetRequest } from "../../models/scalar-widget-actions";
import { ReplaySubject } from "rxjs/ReplaySubject"; import { ReplaySubject } from "rxjs/ReplaySubject";
import { Subject } from "rxjs/Subject"; import { Subject } from "rxjs/Subject";
import { FE_Sticker, FE_StickerPack } from "../../models/integration"; import { FE_Sticker, FE_StickerPack } from "../../models/integration";
import * as randomString from "random-string";
export class ScalarWidgetApi { export class ScalarWidgetApi {
@ -89,6 +90,7 @@ export class ScalarWidgetApi {
request["api"] = "fromWidget"; request["api"] = "fromWidget";
request["widgetId"] = ScalarWidgetApi.widgetId; request["widgetId"] = ScalarWidgetApi.widgetId;
request["action"] = action; request["action"] = action;
request["requestId"] = randomString({length: 160});
window.opener.postMessage(request, "*"); window.opener.postMessage(request, "*");
} }