diff --git a/theseus/src/api/jre.rs b/theseus/src/api/jre.rs index 36c273c7..f8ac91fd 100644 --- a/theseus/src/api/jre.rs +++ b/theseus/src/api/jre.rs @@ -156,7 +156,7 @@ pub async fn auto_install_java(java_version: u32) -> crate::Result { "Failed to extract java zip".to_string(), )) })?; - emit_loading(&loading_bar, 100.0, Some("Done extracting java")).await?; + emit_loading(&loading_bar, 10.0, Some("Done extracting java")).await?; Ok(path .join( download diff --git a/theseus/src/event/emit.rs b/theseus/src/event/emit.rs index 80d1a60d..9b4d1d93 100644 --- a/theseus/src/event/emit.rs +++ b/theseus/src/event/emit.rs @@ -175,7 +175,7 @@ pub async fn emit_loading( ); } - // Emit event to tauri + //Emit event to tauri #[cfg(feature = "tauri")] event_state .app diff --git a/theseus/src/event/mod.rs b/theseus/src/event/mod.rs index 997f2922..deae448f 100644 --- a/theseus/src/event/mod.rs +++ b/theseus/src/event/mod.rs @@ -94,51 +94,43 @@ impl Drop for LoadingBarId { let _event = LoadingBarType::StateInit; let _message = "finished".to_string(); tokio::spawn(async move { - if let Ok(event_state) = crate::EventState::get().await { - { - let mut bars = event_state.loading_bars.write().await; - bars.remove(&loader_uuid); + if let Ok(event_state) = EventState::get().await { + let mut bars = event_state.loading_bars.write().await; + + #[cfg(any(feature = "tauri", feature = "cli"))] + if let Some(bar) = bars.remove(&loader_uuid) { + #[cfg(feature = "tauri")] + { + let loader_uuid = bar.loading_bar_uuid; + let event = bar.bar_type.clone(); + let fraction = bar.current / bar.total; + + use tauri::Manager; + let _ = event_state.app.emit_all( + "loading", + LoadingPayload { + fraction: None, + message: "Completed".to_string(), + event, + loader_uuid, + }, + ); + tracing::debug!( + "Exited at {fraction} for loading bar: {:?}", + loader_uuid + ); + } + + // Emit event to indicatif progress bar arc + #[cfg(feature = "cli")] + { + let cli_progress_bar = bar.cli_progress_bar.clone(); + cli_progress_bar.finish(); + } } - } - }); - } -} -// When Loading bar is dropped, should attempt to throw out one last event to indicate that the loading bar is done -#[cfg(feature = "tauri")] -impl Drop for LoadingBar { - fn drop(&mut self) { - let loader_uuid = self.loading_bar_uuid; - let event = self.bar_type.clone(); - let fraction = self.current / self.total; - - #[cfg(feature = "cli")] - let cli_progress_bar = self.cli_progress_bar.clone(); - - tokio::spawn(async move { - #[cfg(feature = "tauri")] - { - use tauri::Manager; - if let Ok(event_state) = crate::EventState::get().await { - let _ = event_state.app.emit_all( - "loading", - LoadingPayload { - fraction: None, - message: "Completed".to_string(), - event, - loader_uuid, - }, - ); - tracing::debug!( - "Exited at {fraction} for loading bar: {:?}", - loader_uuid - ); - } - } - // Emit event to indicatif progress bar arc - #[cfg(feature = "cli")] - { - cli_progress_bar.finish(); + #[cfg(not(any(feature = "tauri", feature = "cli")))] + bars.remove(&loader_uuid); } }); } diff --git a/theseus_gui/package.json b/theseus_gui/package.json index 721736aa..afa75149 100644 --- a/theseus_gui/package.json +++ b/theseus_gui/package.json @@ -17,7 +17,7 @@ "dayjs": "^1.11.7", "floating-vue": "^2.0.0-beta.20", "ofetch": "^1.0.1", - "omorphia": "^0.4.22", + "omorphia": "^0.4.24", "pinia": "^2.1.3", "vite-svg-loader": "^4.0.0", "vue": "^3.3.4", diff --git a/theseus_gui/pnpm-lock.yaml b/theseus_gui/pnpm-lock.yaml index aeab6b92..de5732e9 100644 --- a/theseus_gui/pnpm-lock.yaml +++ b/theseus_gui/pnpm-lock.yaml @@ -14,8 +14,8 @@ dependencies: specifier: ^1.0.1 version: 1.0.1 omorphia: - specifier: ^0.4.22 - version: 0.4.22 + specifier: ^0.4.24 + version: 0.4.24 pinia: specifier: ^2.1.3 version: 2.1.3(vue@3.3.4) @@ -1326,8 +1326,8 @@ packages: ufo: 1.1.2 dev: false - /omorphia@0.4.22: - resolution: {integrity: sha512-UzG/MqOu/q+F65RZ74oCOLHE4dm716cCkX9EtSP30s8RInd8AHuax4riFKK+ANfCCtE9zcDw4AmU7fJlUnX6Xw==} + /omorphia@0.4.24: + resolution: {integrity: sha512-tYhg88wkv9yfCNF8uVDkt6MIZ5WuCEezWrWJuBpHXP0X1yNGey6ICbH0LSuNuOMtqhGJEIupGEB7uV4Db9b7uQ==} dependencies: dayjs: 1.11.7 floating-vue: 2.0.0-beta.20(vue@3.3.4) diff --git a/theseus_gui/src-tauri/icons/32x32.png b/theseus_gui/src-tauri/icons/32x32.png deleted file mode 100644 index 1bd35561..00000000 Binary files a/theseus_gui/src-tauri/icons/32x32.png and /dev/null differ diff --git a/theseus_gui/src-tauri/tauri.conf.json b/theseus_gui/src-tauri/tauri.conf.json index c6f8a60a..047f59a5 100644 --- a/theseus_gui/src-tauri/tauri.conf.json +++ b/theseus_gui/src-tauri/tauri.conf.json @@ -40,7 +40,6 @@ }, "externalBin": [], "icon": [ - "icons/32x32.png", "icons/128x128.png", "icons/128x128@2x.png", "icons/icon.icns", diff --git a/theseus_gui/src/components/ui/AccountsCard.vue b/theseus_gui/src/components/ui/AccountsCard.vue index 99e30c18..ac2b4c4f 100644 --- a/theseus_gui/src/components/ui/AccountsCard.vue +++ b/theseus_gui/src/components/ui/AccountsCard.vue @@ -25,7 +25,7 @@

Selected

@@ -41,7 +41,7 @@

{{ account.username }}

@@ -54,7 +54,7 @@ diff --git a/theseus_gui/src/components/ui/SearchCard.vue b/theseus_gui/src/components/ui/SearchCard.vue index 46c8bff2..480b0716 100644 --- a/theseus_gui/src/components/ui/SearchCard.vue +++ b/theseus_gui/src/components/ui/SearchCard.vue @@ -1,5 +1,13 @@