From 5834b7e8c6c4040308d3c69f57a2522063e6d041 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20N=C3=A9grier?= Date: Tue, 26 Apr 2022 14:42:08 +0200 Subject: [PATCH] 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. --- front/src/Api/IframeListener.ts | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/front/src/Api/IframeListener.ts b/front/src/Api/IframeListener.ts index f9f2b634..31a89035 100644 --- a/front/src/Api/IframeListener.ts +++ b/front/src/Api/IframeListener.ts @@ -404,12 +404,15 @@ class IframeListener { * @param exceptOrigin Don't dispatch the message to exceptOrigin (to avoid infinite loops) */ sendUserInputChat(message: string, exceptOrigin?: Window) { - this.postMessage({ - type: "userInputChat", - data: { - message: message, - } as UserInputChatEvent, - }, exceptOrigin); + this.postMessage( + { + type: "userInputChat", + data: { + message: message, + } as UserInputChatEvent, + }, + exceptOrigin + ); } sendEnterEvent(name: string) {