Preventing a loop from occuring with chat API
When sending a chat message from the Scripting API, the chat message is no longer sent back to the chat listener. This makes it easier to avoid infinite loops.
This commit is contained in:
parent
5479aea9f0
commit
5834b7e8c6
@ -404,12 +404,15 @@ class IframeListener {
|
|||||||
* @param exceptOrigin Don't dispatch the message to exceptOrigin (to avoid infinite loops)
|
* @param exceptOrigin Don't dispatch the message to exceptOrigin (to avoid infinite loops)
|
||||||
*/
|
*/
|
||||||
sendUserInputChat(message: string, exceptOrigin?: Window) {
|
sendUserInputChat(message: string, exceptOrigin?: Window) {
|
||||||
this.postMessage({
|
this.postMessage(
|
||||||
type: "userInputChat",
|
{
|
||||||
data: {
|
type: "userInputChat",
|
||||||
message: message,
|
data: {
|
||||||
} as UserInputChatEvent,
|
message: message,
|
||||||
}, exceptOrigin);
|
} as UserInputChatEvent,
|
||||||
|
},
|
||||||
|
exceptOrigin
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
sendEnterEvent(name: string) {
|
sendEnterEvent(name: string) {
|
||||||
|
Loading…
Reference in New Issue
Block a user