Эх сурвалжийг харах

refactor(core): return `Window` on `create_window` API (#3211)

Lucas Fernandes Nogueira 3 жил өмнө
parent
commit
e15a8af843

+ 5 - 0
.changes/create-window-return-window.md

@@ -0,0 +1,5 @@
+---
+"tauri": minor
+---
+
+**Breaking change:** Return `Window` on `App` and `AppHandle`'s `create_window` function.

+ 2 - 3
core/tauri/src/app.rs

@@ -372,7 +372,7 @@ macro_rules! shared_app_impl {
         label: impl Into<String>,
         url: WindowUrl,
         setup: F,
-      ) -> crate::Result<()>
+      ) -> crate::Result<Window<R>>
       where
         F: FnOnce(
           <R::Dispatcher as Dispatch>::WindowBuilder,
@@ -390,8 +390,7 @@ macro_rules! shared_app_impl {
           window_builder,
           webview_attributes,
           label,
-        ))?;
-        Ok(())
+        ))
       }
 
       #[cfg(feature = "system-tray")]