Skip to content

Commit

Permalink
fix: reset the shared value on init to avoid keeping the previously s…
Browse files Browse the repository at this point in the history
…et value.
  • Loading branch information
Byron committed Jan 1, 2022
1 parent f426c20 commit aa70a27
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/tree/item.rs
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ impl Item {
/// **Note** that this method can be called multiple times, changing the bounded-ness and unit at will.
pub fn init(&mut self, max: Option<usize>, unit: Option<Unit>) {
if let Some(mut r) = self.tree.get_mut(&self.key) {
self.value = Default::default();
r.value_mut().progress = Some(Value {
done_at: max,
unit,
Expand Down

0 comments on commit aa70a27

Please sign in to comment.