Removed redundant code

This commit is contained in:
Connor Yoh 2025-07-04 16:07:10 +01:00
parent e9f33c5b50
commit f6bcd83b72
2 changed files with 3 additions and 40 deletions

View File

@ -27,7 +27,6 @@ fn reset_starting_flag() {
*starting_guard = false;
}
// Command to start the backend with bundled JRE
#[tauri::command]
async fn start_backend(app: tauri::AppHandle) -> Result<String, String> {
@ -205,10 +204,7 @@ async fn start_backend(app: tauri::AppHandle) -> Result<String, String> {
// Look for startup indicators
if output_str.contains("Started SPDFApplication") ||
output_str.contains("Tomcat started") ||
output_str.contains("Started on port") ||
output_str.contains("Netty started") ||
output_str.contains("Started StirlingPDF") {
output_str.contains("Navigate to "){
_startup_detected = true;
add_log(format!("🎉 Backend startup detected: {}", output_str));
}
@ -296,7 +292,7 @@ async fn check_backend_health() -> Result<bool, String> {
println!("💓 Health check response status: {}", status);
if status.is_success() {
match response.text().await {
Ok(body) => {
Ok(_body) => {
Ok(true)
}
Err(e) => {
@ -423,25 +419,7 @@ pub fn run() {
tauri::Builder::default()
.plugin(tauri_plugin_shell::init())
.plugin(tauri_plugin_fs::init())
.setup(|app| {
// Automatically start the backend when Tauri starts
// let app_handle = app.handle().clone();
// tauri::async_runtime::spawn(
// async move {
// match start_backend(app_handle).await {
// Ok(result) => {
// add_log(format!("🚀 Auto-started backend on Tauri startup: {}", result));
// }
// Err(error) => {
// add_log(format!("❌ Failed to auto-start backend: {}", error));
// }
// }
// });
Ok(())
}
)
.setup(|_app| {Ok(())})
.invoke_handler(tauri::generate_handler![start_backend, check_backend_health, check_jar_exists, get_opened_file])
.build(tauri::generate_context!())
.expect("error while building tauri application")

View File

@ -2,21 +2,6 @@ import { defineConfig } from 'vite';
import react from '@vitejs/plugin-react';
export default defineConfig({
// prevent vite from obscuring rust errors
// clearScreen: false,
// // Env variables starting with the item of `envPrefix` will be exposed in tauri's source code through `import.meta.env`.
// envPrefix: ['VITE_', 'TAURI_ENV_*'],
// build: {
// // Tauri uses Chromium on Windows and WebKit on macOS and Linux
// target:
// process.env.TAURI_ENV_PLATFORM == 'windows'
// ? 'chrome105'
// : 'safari13',
// // don't minify for debug builds
// minify: !process.env.TAURI_ENV_DEBUG ? 'esbuild' : false,
// // produce sourcemaps for debug builds
// sourcemap: !!process.env.TAURI_ENV_DEBUG,
// },
plugins: [react()],
server: {
// make sure this port matches the devUrl port in tauri.conf.json file