From b7d4714fce2cbac87da03f13e36f70259b6b10a0 Mon Sep 17 00:00:00 2001 From: Jack Date: Sun, 13 Dec 2020 01:15:45 +0000 Subject: [PATCH] disabled config sync for testing --- src/js/account.js | 84 +++++++++++++++++++++----------------------- src/js/userconfig.js | 34 +++++++++--------- static/index.html | 5 +++ 3 files changed, 63 insertions(+), 60 deletions(-) diff --git a/src/js/account.js b/src/js/account.js index ff5b9dcbb..c8da7d793 100644 --- a/src/js/account.js +++ b/src/js/account.js @@ -317,49 +317,47 @@ function getAccountDataAndInit() { saveConfigToCookie(true); restartTest(false, true); } else if (db_getSnapshot().config !== undefined) { - let configsDifferent = false; - Object.keys(config).forEach((key) => { - if (!configsDifferent) { - try { - if (key !== "resultFilters") { - if (Array.isArray(config[key])) { - config[key].forEach((arrval, index) => { - if (arrval != db_getSnapshot().config[key][index]) { - configsDifferent = true; - console.log( - `.config is different: ${arrval} != ${ - db_getSnapshot().config[key][index] - }` - ); - } - }); - } else { - if (config[key] != db_getSnapshot().config[key]) { - configsDifferent = true; - console.log( - `..config is different ${key}: ${config[key]} != ${ - db_getSnapshot().config[key] - }` - ); - } - } - } - } catch (e) { - console.log(e); - configsDifferent = true; - console.log(`...config is different: ${e.message}`); - } - } - }); - if (configsDifferent) { - console.log("applying config from db"); - accountIconLoading(false); - config = db_getSnapshot().config; - applyConfig(config); - updateSettingsPage(); - saveConfigToCookie(true); - restartTest(false, true); - } + // let configsDifferent = false; + // Object.keys(config).forEach((key) => { + // if (!configsDifferent) { + // try { + // if (key !== "resultFilters") { + // if (Array.isArray(config[key])) { + // config[key].forEach((arrval, index) => { + // if (arrval != db_getSnapshot().config[key][index]) { + // configsDifferent = true; + // console.log( + // `.config is different: ${arrval} != ${db_getSnapshot().config[key][index] + // }` + // ); + // } + // }); + // } else { + // if (config[key] != db_getSnapshot().config[key]) { + // configsDifferent = true; + // console.log( + // `..config is different ${key}: ${config[key]} != ${db_getSnapshot().config[key] + // }` + // ); + // } + // } + // } + // } catch (e) { + // console.log(e); + // configsDifferent = true; + // console.log(`...config is different: ${e.message}`); + // } + // } + // }); + // if (configsDifferent) { + // console.log("applying config from db"); + // accountIconLoading(false); + // config = db_getSnapshot().config; + // applyConfig(config); + // updateSettingsPage(); + // saveConfigToCookie(true); + // restartTest(false, true); + // } } dbConfigLoaded = true; } else { diff --git a/src/js/userconfig.js b/src/js/userconfig.js index faf299378..6c3d839e1 100644 --- a/src/js/userconfig.js +++ b/src/js/userconfig.js @@ -102,23 +102,23 @@ async function saveConfigToCookie(noDbCheck = false) { } async function saveConfigToDB() { - if (firebase.auth().currentUser !== null) { - accountIconLoading(true); - CloudFunctions.saveConfig({ - uid: firebase.auth().currentUser.uid, - obj: config, - }).then((d) => { - accountIconLoading(false); - if (d.data.returnCode === 1) { - } else { - Misc.showNotification( - `Error saving config to DB! ${d.data.message}`, - 4000 - ); - } - return; - }); - } + // if (firebase.auth().currentUser !== null) { + // accountIconLoading(true); + // CloudFunctions.saveConfig({ + // uid: firebase.auth().currentUser.uid, + // obj: config, + // }).then((d) => { + // accountIconLoading(false); + // if (d.data.returnCode === 1) { + // } else { + // Misc.showNotification( + // `Error saving config to DB! ${d.data.message}`, + // 4000 + // ); + // } + // return; + // }); + // } } function resetConfig() { diff --git a/static/index.html b/static/index.html index e51507f3c..e947d55a0 100644 --- a/static/index.html +++ b/static/index.html @@ -1509,6 +1509,11 @@ esc ) +
+ For testing purposes, account config synchronisation has been + temporarily disabled (only local config will be remembered). Sorry + for the inconvenience. +