From 77d8c593b34e7b1f3fb721708be1507fb07b8954 Mon Sep 17 00:00:00 2001 From: Thomas Lamprecht Date: Mon, 22 Nov 2021 10:25:38 +0100 Subject: [PATCH] ui: traffic-control edit: simpler unique timeframe logic still just a heuristic, i.e., it does the same as previously but in one line.. Signed-off-by: Thomas Lamprecht --- www/window/TrafficControlEdit.js | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/www/window/TrafficControlEdit.js b/www/window/TrafficControlEdit.js index af6241d2..e7436391 100644 --- a/www/window/TrafficControlEdit.js +++ b/www/window/TrafficControlEdit.js @@ -204,14 +204,7 @@ Ext.define('PBS.window.TrafficControlEdit', { delete values.timeframe; } if (values.timeframe && !Ext.isArray(values.timeframe)) { - let timeframe = [], seen = {}; - values.timeframe.split(';').forEach(tf => { - if (!seen[tf]) { - timeframe.push(tf); - seen[tf] = true; - } - }); - values.timeframe = timeframe; + values.timeframe = [...new Set(values.timeframe.split(';'))]; } if (!isCreate) {