Commit 45a711bf authored by Yoann HOUPERT's avatar Yoann HOUPERT
Browse files

stop sending same reco if no change

parent 561abb94
Pipeline #3444 failed with stage
in 41 seconds
......@@ -11,6 +11,7 @@ const config = arguments[1];
robotController.external.load(config);
robot = {
previousReco: [],
recordedParticipantsWS: {},
participantsMediaRecorders: {},
......@@ -25,8 +26,24 @@ robot = {
processReco(reco) {
reco = JSON.parse(reco);
let formattedReco = '';
let previousReco = [];
let isRecom = false;
if (reco.keywords && reco.keywords.length > 0) {
for (let i = 0; i < reco.keywords.length; i++) {
if(!isRecom && robot.previousReco.indexOf(reco.keywords[i].key) === -1) {
isRecom = true;
}
previousReco.push(reco.keywords[i].key);
}
robot.previousReco = previousReco;
if(!isRecom){
return;
}
formattedReco += '<h5>Mots-Clés</h5> ';
for (let i = 0; i < reco.keywords.length; i++) {
formattedReco += reco.keywords[i].key + ', ';
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment