mirror of
https://github.com/vector-im/element-web.git
synced 2025-08-20 05:51:08 +02:00
Add a warning for widget developers when their postMessage is missing a requestId
Signed-off-by: Travis Ralston <travpc@gmail.com>
This commit is contained in:
parent
0522ab8fcd
commit
1515ca11a8
@ -116,6 +116,12 @@ export default class FromWidgetPostMessageApi {
|
|||||||
return; // don't log this - debugging APIs like to spam postMessage which floods the log otherwise
|
return; // don't log this - debugging APIs like to spam postMessage which floods the log otherwise
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Although the requestId is required, we don't use it. We'll be nice and process the message
|
||||||
|
// if the property is missing, but with a warning for widget developers.
|
||||||
|
if (!event.data.requestId) {
|
||||||
|
console.warn("fromWidget action '" + event.data.action + "' does not have a requestId");
|
||||||
|
}
|
||||||
|
|
||||||
const action = event.data.action;
|
const action = event.data.action;
|
||||||
const widgetId = event.data.widgetId;
|
const widgetId = event.data.widgetId;
|
||||||
if (action === 'content_loaded') {
|
if (action === 'content_loaded') {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user