diff --git a/src-tauri/capabilities/default.json b/src-tauri/capabilities/default.json index 4ee28e5..3ed3d05 100644 --- a/src-tauri/capabilities/default.json +++ b/src-tauri/capabilities/default.json @@ -18,6 +18,7 @@ "core:window:allow-start-dragging", "core:window:allow-toggle-maximize", "core:window:allow-request-user-attention", + "core:webview:allow-create-webview-window", "fs:default", "dialog:default", "dialog:allow-open", diff --git a/src-tauri/src/lib.rs b/src-tauri/src/lib.rs index 3dd63b8..14e622c 100644 --- a/src-tauri/src/lib.rs +++ b/src-tauri/src/lib.rs @@ -678,31 +678,6 @@ fn remove_stale_executable(app: AppHandle, version: String, executable: String) } } -#[tauri::command] -fn open_new_window( - app: tauri::AppHandle, - title: String, - name: String, - url: String, - width: f64, - height: f64, -) { - if let Some(window) = app.get_webview_window(&name) { - let _ = window.show(); - return; - }; - - tauri::WebviewWindowBuilder::new( - &app, - name, - tauri::WebviewUrl::External(url.parse().unwrap()), - ) - .inner_size(width, height) - .title(title) - .build() - .unwrap(); -} - #[cfg_attr(mobile, tauri::mobile_entry_point)] pub fn run() { #[allow(unused)] @@ -731,7 +706,6 @@ pub fn run() { folder_size, verify_signature, cancel_download, - open_new_window, move_game_data, restart_app, open_game_folder, diff --git a/src/app/main/game/page.tsx b/src/app/main/game/page.tsx index c5b9500..497d161 100644 --- a/src/app/main/game/page.tsx +++ b/src/app/main/game/page.tsx @@ -2,7 +2,6 @@ import '../Installs.css' import { useEffect } from 'react' -import { invoke } from '@tauri-apps/api/core' import { useGlobal } from '@/providers/GlobalProvider' import { useSearchParams } from 'next/navigation' import { platform } from '@tauri-apps/plugin-os' @@ -10,6 +9,7 @@ import { faWarning } from '@fortawesome/free-solid-svg-icons' import { FontAwesomeIcon } from '@fortawesome/react-fontawesome' import { ask } from '@tauri-apps/plugin-dialog' import { BaseDirectory, exists } from '@tauri-apps/plugin-fs' +import { WebviewWindow } from '@tauri-apps/api/webviewWindow' export default function Installs () { const { @@ -74,14 +74,15 @@ export default function Installs () {