From 01183a3c259cd9434d8def3ba55dee0c24ff5659 Mon Sep 17 00:00:00 2001 From: Oliver Giles Date: Sat, 3 Sep 2022 19:53:14 +1200 Subject: [PATCH] wallboard: fix stuck page without filter query if no filter param is provided, use a copy of the jobs array to avoid an infinite sort loop in the frontend resolves #174 --- src/resources/js/app.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/resources/js/app.js b/src/resources/js/app.js index 349d4e9..2022209 100644 --- a/src/resources/js/app.js +++ b/src/resources/js/app.js @@ -543,7 +543,7 @@ const All = templateId => { if (expr) ret = state.jobs.filter(job => (new RegExp(expr)).test(job.name)); else - ret = state.jobs; + ret = [...state.jobs]; // sort failed before success, newest first ret.sort((a,b) => a.result == b.result ? a.started - b.started : 2*(b.result == 'success')-1); return ret;