Procházet zdrojové kódy

fix(tui): --continue selects wrong session (#5513)

Ravi Kumar před 11 měsíci
rodič
revize
fdf560c343
1 změnil soubory, kde provedl 3 přidání a 1 odebrání
  1. 3 1
      packages/opencode/src/cli/cmd/tui/app.tsx

+ 3 - 1
packages/opencode/src/cli/cmd/tui/app.tsx

@@ -218,7 +218,9 @@ function App() {
   let continued = false
   createEffect(() => {
     if (continued || sync.status !== "complete" || !args.continue) return
-    const match = sync.data.session.find((x) => x.parentID === undefined)?.id
+    const match = sync.data.session
+      .toSorted((a, b) => b.time.updated - a.time.updated)
+      .find((x) => x.parentID === undefined)?.id
     if (match) {
       continued = true
       route.navigate({ type: "session", sessionID: match })