desktop v2 migration finalising (#36912)

This commit is contained in:
Brendan Allan
2026-07-15 03:56:47 +08:00
committed by GitHub
parent bfddf05782
commit 4a181c3574
9 changed files with 155 additions and 46 deletions
+1 -1
View File
@@ -7,7 +7,7 @@ import { FIRST_LAUNCH_ONBOARDING_COMPLETE_KEY, OLD_LAYOUT_ELIGIBLE_KEY } from ".
import { write as writeLog } from "./logging"
import { hasExistingAppState } from "./install-state"
const DEFAULT_PROJECT_DIR = "New OpenCode Project"
const DEFAULT_PROJECT_DIR = "Default Project"
export function initializeOldLayoutEligibility(userDataPath: string) {
const entries = existsSync(userDataPath) ? readdirSync(userDataPath, { withFileTypes: true }) : []
+5 -1
View File
@@ -36,6 +36,7 @@ protocol.registerSchemesAsPrivileged([
secure: true,
standard: true,
supportFetchAPI: true,
stream: true,
},
},
])
@@ -266,7 +267,10 @@ export function registerRendererProtocol() {
}
try {
const response = await net.fetch(pathToFileURL(file).toString())
const range = request.headers.get("range")
const response = await net.fetch(pathToFileURL(file).toString(), {
headers: range ? { range } : undefined,
})
if (response.status >= 400) {
writeLog(
"protocol",