Skip to content

Commit 3cd2f94

Browse files
committed
Updated web-sys to min version 0.3.86 because of Geolocation API
changes.
1 parent 4b32745 commit 3cd2f94

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
88
### Fixes 🍕
99

1010
- Added `GeolocationPosition` and `GeolocationPositionError` web-sys features as dependencies for use_geolocation.
11+
- Updated `web-sys` to min version `0.3.86` because of Geolocation API changes.
1112

1213
### Special thanks to our sponsor
1314
- @benwis

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ thiserror = "2"
3939
unic-langid = { version = "0.9", optional = true }
4040
wasm-bindgen = "0.2"
4141
wasm-bindgen-futures = "0.4"
42-
web-sys = { version = "0.3", optional = true }
42+
web-sys = { version = "0.3.86", optional = true }
4343
reactive_stores = { version = "0.3.1", optional = true }
4444

4545
[dev-dependencies]

src/use_geolocation.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -102,13 +102,12 @@ pub fn use_geolocation_with_options(
102102
let on_error =
103103
Closure::wrap(Box::new(on_error) as Box<dyn Fn(web_sys::PositionError)>);
104104

105-
*watch_handle.lock().unwrap() = geolocation
105+
*watch_handle.lock().unwrap() = Some(geolocation
106106
.watch_position_with_error_callback_and_options(
107107
update_position.as_ref().unchecked_ref(),
108108
Some(on_error.as_ref().unchecked_ref()),
109109
&position_options,
110-
)
111-
.ok();
110+
));
112111

113112
update_position.forget();
114113
on_error.forget();

0 commit comments

Comments
 (0)