mirror of
https://github.com/zaphar/kitchen.git
synced 2025-07-22 19:40:14 -04:00
Load plan from local_store if http fetch fails
This commit is contained in:
parent
9af13c5bb4
commit
a6a5edcc40
@ -188,10 +188,14 @@ impl StateMachine {
|
|||||||
}
|
}
|
||||||
state.recipe_counts = plan_map;
|
state.recipe_counts = plan_map;
|
||||||
} else {
|
} else {
|
||||||
// Initialize things to zero
|
if let Some(plan) = local_store.get_plan() {
|
||||||
if let Some(rs) = recipe_entries {
|
state.recipe_counts = plan.iter().map(|(k, v)| (k.clone(), *v as usize)).collect();
|
||||||
for r in rs {
|
} else {
|
||||||
state.recipe_counts.insert(r.recipe_id().to_owned(), 0);
|
// Initialize things to zero.
|
||||||
|
if let Some(rs) = recipe_entries {
|
||||||
|
for r in rs {
|
||||||
|
state.recipe_counts.insert(r.recipe_id().to_owned(), 0);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user