AW-2714
Some checks failed
FarmMaps.Develop/FarmMapsLib/pipeline/head There was a failure building this commit

This commit is contained in:
Willem Dantuma
2021-08-17 19:36:30 +02:00
parent e0f36b043f
commit c0c9864b07
7 changed files with 55 additions and 27 deletions

View File

@@ -82,9 +82,17 @@ export function LocalStorageSync(reducer: ActionReducer<any>): ActionReducer<any
if(ms) {
r2["mapState"] = JSON.parse(ms);
}
let sp = window.localStorage.getItem(MODULE_NAME+"_searchPeriod");
if(sp) {
let p = JSON.parse(sp);
r2["period"] = { startDate: new Date(Date.parse(p.startDate)),endDate:new Date(Date.parse(p.endDate))};
}
}
if(action.type == "[Map] MapState" || action.type == "[Map] SetState") {
window.localStorage.setItem(MODULE_NAME + "_mapState",JSON.stringify(r2["mapState"]));
window.localStorage.setItem(MODULE_NAME + "_mapState",JSON.stringify(r2["mapState"]));
}
if(action.type == "[Map] SetPeriod" ) {
window.localStorage.setItem(MODULE_NAME + "_searchPeriod",JSON.stringify(r2["period"]));
}
return r2;