fix(desktop): remove deprecated wsl platform properties from tauri

This commit is contained in:
LukeParkerDev 2026-04-19 13:23:24 +10:00
parent bc84698428
commit 6ae05c541d

View file

@ -70,12 +70,16 @@ const createPlatform = (): Platform => {
})()
const wslHome = async () => {
if (os !== "windows" || !window.__OPENCODE__?.wsl) return undefined
if (os !== "windows") return undefined
const wsl = await commands.getWslConfig().catch(() => null)
if (!wsl?.enabled) return undefined
return commands.wslPath("~", "windows").catch(() => undefined)
}
const handleWslPicker = async <T extends string | string[]>(result: T | null): Promise<T | null> => {
if (!result || !window.__OPENCODE__?.wsl) return result
if (!result) return result
const wsl = await commands.getWslConfig().catch(() => null)
if (!wsl?.enabled) return result
if (Array.isArray(result)) {
return Promise.all(result.map((path) => commands.wslPath(path, "linux").catch(() => path))) as any
}
@ -343,16 +347,6 @@ const createPlatform = (): Platform => {
}
},
getWslEnabled: async () => {
const next = await commands.getWslConfig().catch(() => null)
if (next) return next.enabled
return window.__OPENCODE__!.wsl ?? false
},
setWslEnabled: async (enabled) => {
await commands.setWslConfig({ enabled })
},
getDefaultServer: async () => {
const url = await commands.getDefaultServerUrl().catch(() => null)
if (!url) return null