Przeglądaj źródła

fix: wry pathing

Jonathan Kelley 3 lat temu
rodzic
commit
bad36162af
2 zmienionych plików z 3 dodań i 3 usunięć
  1. 1 1
      packages/desktop/src/index.html
  2. 2 2
      packages/desktop/src/lib.rs

+ 1 - 1
packages/desktop/src/index.html

@@ -15,4 +15,4 @@
 <script type="text/javascript" src="index.js">
 </script>
 
-</html>
+</html>

+ 2 - 2
packages/desktop/src/lib.rs

@@ -174,7 +174,7 @@ pub fn launch_with_props<P: 'static + Send>(
 
                 let mut webview = WebViewBuilder::new(window)
                     .unwrap()
-                    .with_url("wry://index.html/")
+                    .with_url("dioxus://index.html/")
                     .unwrap()
                     .with_rpc_handler(move |_window: &Window, req: RpcRequest| {
                         match req.method.as_str() {
@@ -200,7 +200,7 @@ pub fn launch_with_props<P: 'static + Send>(
                             wry::http::ResponseBuilder::new()
                                 .mimetype("text/html")
                                 .body(include_bytes!("./index.html").to_vec())
-                        } else if path == "index.js" {
+                        } else if path.trim_end_matches("/") == "index.html/index.js" {
                             wry::http::ResponseBuilder::new()
                                 .mimetype("text/javascript")
                                 .body(include_bytes!("./index.js").to_vec())