mirror of
https://github.com/monkeytypegame/monkeytype.git
synced 2025-02-05 21:33:40 +08:00
fixed filters getting overwritten with default filters, making loading useless. closes #1273
This commit is contained in:
parent
c59f203e90
commit
49f42fca3c
3 changed files with 6 additions and 4 deletions
|
@ -287,6 +287,7 @@ let totalSecondsFiltered = 0;
|
|||
|
||||
export function update() {
|
||||
function cont() {
|
||||
console.log("updating account page");
|
||||
ThemeColors.update();
|
||||
ChartController.accountHistory.updateColors();
|
||||
ChartController.accountActivity.updateColors();
|
||||
|
|
|
@ -62,7 +62,7 @@ let defaultResultFilters = {
|
|||
},
|
||||
};
|
||||
|
||||
export let filters;
|
||||
export let filters = defaultResultFilters;
|
||||
|
||||
Promise.all([Misc.getLanguageList(), Misc.getFunboxList()]).then((values) => {
|
||||
let languages = values[0];
|
||||
|
@ -73,7 +73,7 @@ Promise.all([Misc.getLanguageList(), Misc.getFunboxList()]).then((values) => {
|
|||
funboxModes.forEach((funbox) => {
|
||||
defaultResultFilters.funbox[funbox.name] = true;
|
||||
});
|
||||
filters = defaultResultFilters;
|
||||
// filters = defaultResultFilters;
|
||||
});
|
||||
|
||||
export function getFilters() {
|
||||
|
@ -110,7 +110,7 @@ export function load() {
|
|||
// let newTags = $.cookie("activeTags");
|
||||
try {
|
||||
let newResultFilters = window.localStorage.getItem("resultFilters");
|
||||
if (newResultFilters !== undefined && newResultFilters !== "") {
|
||||
if (newResultFilters != undefined && newResultFilters !== "") {
|
||||
filters = JSON.parse(newResultFilters);
|
||||
save();
|
||||
} else {
|
||||
|
@ -118,6 +118,7 @@ export function load() {
|
|||
save();
|
||||
}
|
||||
} catch {
|
||||
console.log("error in loading result filters");
|
||||
filters = defaultResultFilters;
|
||||
save();
|
||||
}
|
||||
|
|
|
@ -11,4 +11,4 @@ global.config = Config;
|
|||
// global.addnotif = Notifications.add;
|
||||
global.link = AccountController.linkWithGoogle;
|
||||
|
||||
global.filters = ResultFilters.filters;
|
||||
global.filters = ResultFilters.getFilters();
|
||||
|
|
Loading…
Reference in a new issue