desktop: cleanup
This commit is contained in:
@@ -19,6 +19,8 @@ use tokio::{
|
|||||||
use tokio_stream::wrappers::ReceiverStream;
|
use tokio_stream::wrappers::ReceiverStream;
|
||||||
use tracing::Instrument;
|
use tracing::Instrument;
|
||||||
|
|
||||||
|
use crate::server::get_wsl_config;
|
||||||
|
|
||||||
|
|
||||||
const CLI_INSTALL_DIR: &str = ".opencode/bin";
|
const CLI_INSTALL_DIR: &str = ".opencode/bin";
|
||||||
const CLI_BINARY_NAME: &str = "opencode";
|
const CLI_BINARY_NAME: &str = "opencode";
|
||||||
@@ -201,7 +203,7 @@ fn get_user_shell() -> String {
|
|||||||
}
|
}
|
||||||
|
|
||||||
fn is_wsl_enabled(_app: &tauri::AppHandle) -> bool {
|
fn is_wsl_enabled(_app: &tauri::AppHandle) -> bool {
|
||||||
false
|
get_wsl_config(_app.clone()).is_ok_and(|v| v.enabled)
|
||||||
}
|
}
|
||||||
|
|
||||||
fn shell_escape(input: &str) -> String {
|
fn shell_escape(input: &str) -> String {
|
||||||
|
|||||||
@@ -55,18 +55,18 @@ pub async fn set_default_server_url(app: AppHandle, url: Option<String>) -> Resu
|
|||||||
|
|
||||||
#[tauri::command]
|
#[tauri::command]
|
||||||
#[specta::specta]
|
#[specta::specta]
|
||||||
pub fn get_wsl_config(app: AppHandle) -> Result<WslConfig, String> {
|
pub fn get_wsl_config(_app: AppHandle) -> Result<WslConfig, String> {
|
||||||
let store = app
|
// let store = app
|
||||||
.store(SETTINGS_STORE)
|
// .store(SETTINGS_STORE)
|
||||||
.map_err(|e| format!("Failed to open settings store: {}", e))?;
|
// .map_err(|e| format!("Failed to open settings store: {}", e))?;
|
||||||
|
|
||||||
let enabled = store
|
// let enabled = store
|
||||||
.get(WSL_ENABLED_KEY)
|
// .get(WSL_ENABLED_KEY)
|
||||||
.as_ref()
|
// .as_ref()
|
||||||
.and_then(|v| v.as_bool())
|
// .and_then(|v| v.as_bool())
|
||||||
.unwrap_or(false);
|
// .unwrap_or(false);
|
||||||
|
|
||||||
Ok(WslConfig { enabled })
|
Ok(WslConfig { enabled: false })
|
||||||
}
|
}
|
||||||
|
|
||||||
#[tauri::command]
|
#[tauri::command]
|
||||||
|
|||||||
Reference in New Issue
Block a user