[WebHost] Do not calculate settingHash multiple times in weighted-settings

This commit is contained in:
Chris Wilson 2022-04-04 19:38:42 -04:00 committed by KonoTyran
parent 535c35310d
commit 3f43051c35
1 changed files with 2 additions and 2 deletions

View File

@ -3,9 +3,9 @@ window.addEventListener('load', () => {
let settingHash = localStorage.getItem('weighted-settings-hash'); let settingHash = localStorage.getItem('weighted-settings-hash');
if (!settingHash) { if (!settingHash) {
// If no hash data has been set before, set it now // 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)); settingHash = md5(JSON.stringify(results));
localStorage.setItem('weighted-settings-hash', settingHash);
localStorage.removeItem('weighted-settings');
} }
if (settingHash !== md5(JSON.stringify(results))) { if (settingHash !== md5(JSON.stringify(results))) {