Skip to content

Commit

Permalink
docs(webview): fix doc typo in webview window builder (#9476)
Browse files Browse the repository at this point in the history
* fix(webview): typo in webview window builder document

* Update core/tauri/src/webview/webview_window.rs

---------

Co-authored-by: Fabian-Lars <[email protected]>
  • Loading branch information
washanhanzi and FabianLars authored Apr 16, 2024
1 parent 55bf4eb commit 3fe9ae8
Showing 1 changed file with 12 additions and 17 deletions.
29 changes: 12 additions & 17 deletions core/tauri/src/webview/webview_window.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ pub struct WebviewWindowBuilder<'a, R: Runtime, M: Manager<R>> {
}

impl<'a, R: Runtime, M: Manager<R>> WebviewWindowBuilder<'a, R, M> {
/// Initializes a window builder with the given window label.
/// Initializes a webview window builder with the given window label.
///
/// # Known issues
///
Expand Down Expand Up @@ -106,9 +106,9 @@ impl<'a, R: Runtime, M: Manager<R>> WebviewWindowBuilder<'a, R, M> {
}
}

/// Initializes a window builder from a [`WindowConfig`] from tauri.conf.json.
/// Initializes a webview window builder from a [`WindowConfig`] from tauri.conf.json.
/// Keep in mind that you can't create 2 windows with the same `label` so make sure
/// that the initial window was closed or change the label of the new [`WindowBuilder`].
/// that the initial window was closed or change the label of the new [`WebviewWindowBuilder`].
///
/// # Known issues
///
Expand All @@ -119,20 +119,15 @@ impl<'a, R: Runtime, M: Manager<R>> WebviewWindowBuilder<'a, R, M> {
///
/// - Create a window in a command:
///
#[cfg_attr(
feature = "unstable",
doc = r####"
```
#[tauri::command]
async fn reopen_window(app: tauri::AppHandle) {
let webview_window = tauri::window::WindowBuilder::from_config(&app, &app.config().app.windows.get(0).unwrap().clone())
.unwrap()
.build()
.unwrap();
}
```
"####
)]
/// ```
/// #[tauri::command]
/// async fn reopen_window(app: tauri::AppHandle) {
/// let webview_window = tauri::WebviewWindowBuilder::from_config(&app, &app.config().app.windows.get(0).unwrap().clone())
/// .unwrap()
/// .build()
/// .unwrap();
/// }
/// ```
///
/// [the Webview2 issue]: https://github.com/tauri-apps/wry/issues/583
pub fn from_config(manager: &'a M, config: &WindowConfig) -> crate::Result<Self> {
Expand Down

0 comments on commit 3fe9ae8

Please sign in to comment.