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 <t.lamprecht@proxmox.com>
This commit is contained in:
parent
c450a3cafd
commit
77d8c593b3
|
@ -204,14 +204,7 @@ Ext.define('PBS.window.TrafficControlEdit', {
|
||||||
delete values.timeframe;
|
delete values.timeframe;
|
||||||
}
|
}
|
||||||
if (values.timeframe && !Ext.isArray(values.timeframe)) {
|
if (values.timeframe && !Ext.isArray(values.timeframe)) {
|
||||||
let timeframe = [], seen = {};
|
values.timeframe = [...new Set(values.timeframe.split(';'))];
|
||||||
values.timeframe.split(';').forEach(tf => {
|
|
||||||
if (!seen[tf]) {
|
|
||||||
timeframe.push(tf);
|
|
||||||
seen[tf] = true;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
values.timeframe = timeframe;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!isCreate) {
|
if (!isCreate) {
|
||||||
|
|
Loading…
Reference in New Issue