Skip to content

Commit 6cd3a59

Browse files
committed
desktop: cleanup
1 parent 5aeb305 commit 6cd3a59

File tree

2 files changed

+15
-13
lines changed

2 files changed

+15
-13
lines changed

packages/desktop/src-tauri/src/cli.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ use tokio::{
1919
use tokio_stream::wrappers::ReceiverStream;
2020
use tracing::Instrument;
2121

22+
use crate::server::get_wsl_config;
23+
2224

2325
const CLI_INSTALL_DIR: &str = ".opencode/bin";
2426
const CLI_BINARY_NAME: &str = "opencode";
@@ -201,7 +203,7 @@ fn get_user_shell() -> String {
201203
}
202204

203205
fn is_wsl_enabled(_app: &tauri::AppHandle) -> bool {
204-
false
206+
get_wsl_config(_app.clone()).is_ok_and(|v| v.enabled)
205207
}
206208

207209
fn shell_escape(input: &str) -> String {

packages/desktop/src-tauri/src/server.rs

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -55,18 +55,18 @@ pub async fn set_default_server_url(app: AppHandle, url: Option<String>) -> Resu
5555

5656
#[tauri::command]
5757
#[specta::specta]
58-
pub fn get_wsl_config(app: AppHandle) -> Result<WslConfig, String> {
59-
let store = app
60-
.store(SETTINGS_STORE)
61-
.map_err(|e| format!("Failed to open settings store: {}", e))?;
62-
63-
let enabled = store
64-
.get(WSL_ENABLED_KEY)
65-
.as_ref()
66-
.and_then(|v| v.as_bool())
67-
.unwrap_or(false);
68-
69-
Ok(WslConfig { enabled })
58+
pub fn get_wsl_config(_app: AppHandle) -> Result<WslConfig, String> {
59+
// let store = app
60+
// .store(SETTINGS_STORE)
61+
// .map_err(|e| format!("Failed to open settings store: {}", e))?;
62+
63+
// let enabled = store
64+
// .get(WSL_ENABLED_KEY)
65+
// .as_ref()
66+
// .and_then(|v| v.as_bool())
67+
// .unwrap_or(false);
68+
69+
Ok(WslConfig { enabled: false })
7070
}
7171

7272
#[tauri::command]

0 commit comments

Comments
 (0)