disabled config sync for testing

This commit is contained in:
Jack 2020-12-13 01:15:45 +00:00
parent 42e87185dc
commit b7d4714fce
3 changed files with 63 additions and 60 deletions

View file

@ -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 {

View file

@ -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() {

View file

@ -1509,6 +1509,11 @@
<key>esc</key>
)
</div>
<div style="text-align: center">
For testing purposes, account config synchronisation has been
temporarily disabled (only local config will be remembered). Sorry
for the inconvenience.
</div>
<!-- <div class="sectionGroupTitle">quick navigation</div> -->
<div class="settingsGroup quickNav">
<div class="links">