From 3f43051c3553eb8aaa8293e9296cfd5501f7e21c Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Mon, 4 Apr 2022 19:38:42 -0400 Subject: [PATCH] [WebHost] Do not calculate settingHash multiple times in weighted-settings --- WebHostLib/static/assets/weighted-settings.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/WebHostLib/static/assets/weighted-settings.js b/WebHostLib/static/assets/weighted-settings.js index 575b5c1219..c963e74cec 100644 --- a/WebHostLib/static/assets/weighted-settings.js +++ b/WebHostLib/static/assets/weighted-settings.js @@ -3,9 +3,9 @@ window.addEventListener('load', () => { let settingHash = localStorage.getItem('weighted-settings-hash'); if (!settingHash) { // If no hash data has been set before, set it now - localStorage.setItem('weighted-settings-hash', md5(JSON.stringify(results))); - localStorage.removeItem('weighted-settings'); settingHash = md5(JSON.stringify(results)); + localStorage.setItem('weighted-settings-hash', settingHash); + localStorage.removeItem('weighted-settings'); } if (settingHash !== md5(JSON.stringify(results))) {