Skip to content

Commit

Permalink
fixed use_infinity_scroll disposed signals bug
Browse files Browse the repository at this point in the history
fixes #98
  • Loading branch information
maccesch committed Apr 27, 2024
1 parent 2cda3f8 commit aebff60
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Fixes 🍕

- Fixed `use_color_mode` without cookies and make cookies sync properly with local storage
- Fixed `use_infinite_scroll` edge case bug with disposed signals

## [0.10.8] - 2024-04-19

Expand Down
4 changes: 2 additions & 2 deletions src/use_infinite_scroll.rs
Original file line number Diff line number Diff line change
Expand Up @@ -168,10 +168,10 @@ where
#[cfg(debug_assertions)]
SpecialNonReactiveZone::exit(prev);

set_loading.set(false);
set_loading.try_set(false);
sleep(Duration::ZERO).await;
measure();
if let Some(check_and_load) = check_and_load.get_value() {
if let Some(check_and_load) = check_and_load.try_get_value().flatten() {
check_and_load();
}
});
Expand Down
2 changes: 1 addition & 1 deletion src/use_scroll.rs
Original file line number Diff line number Diff line change
Expand Up @@ -421,7 +421,7 @@ where
);

let measure = move || {
if let Some(el) = signal.get_untracked() {
if let Some(el) = signal.try_get_untracked().flatten() {
let el = el.into();
set_arrived_state(el);
}
Expand Down

0 comments on commit aebff60

Please sign in to comment.