mirror of
https://github.com/tauri-apps/tauri.git
synced 2024-07-14 19:10:28 +03:00
refactor!: change Webview::navigate
to return result (#10134)
closes #9935
This commit is contained in:
parent
77d44215ef
commit
3afe828940
5
.changes/webview-navigate-result.md
Normal file
5
.changes/webview-navigate-result.md
Normal file
@ -0,0 +1,5 @@
|
||||
---
|
||||
"tauri": "patch:breaking"
|
||||
---
|
||||
|
||||
Changed `WebviewWindow::navigate` and `Webview::navigate` method signature to return a `Result`
|
@ -1084,8 +1084,8 @@ fn main() {
|
||||
}
|
||||
|
||||
/// Navigates the webview to the defined url.
|
||||
pub fn navigate(&mut self, url: Url) {
|
||||
self.webview.dispatcher.navigate(url).unwrap();
|
||||
pub fn navigate(&mut self, url: Url) -> crate::Result<()> {
|
||||
self.webview.dispatcher.navigate(url).map_err(Into::into)
|
||||
}
|
||||
|
||||
fn is_local_url(&self, current_url: &Url) -> bool {
|
||||
|
@ -1665,8 +1665,8 @@ impl<R: Runtime> WebviewWindow<R> {
|
||||
}
|
||||
|
||||
/// Navigates the webview to the defined url.
|
||||
pub fn navigate(&mut self, url: Url) {
|
||||
self.webview.navigate(url);
|
||||
pub fn navigate(&mut self, url: Url) -> crate::Result<()> {
|
||||
self.webview.navigate(url)
|
||||
}
|
||||
|
||||
/// Handles this window receiving an [`crate::webview::InvokeRequest`].
|
||||
|
Loading…
Reference in New Issue
Block a user