瀏覽代碼

fix(tui): preserve model variants across sessions

Aiden Cline 1 周之前
父節點
當前提交
72d9dcf470
共有 1 個文件被更改,包括 5 次插入0 次删除
  1. 5 0
      packages/tui/src/app.tsx

+ 5 - 0
packages/tui/src/app.tsx

@@ -642,6 +642,7 @@ function App(props: { pair?: DialogPairCredentials }) {
         category: "Session",
         slash: { name: "new", aliases: ["clear"] },
         run: () => {
+          const selection = local.model.selection()
           route.navigate({
             type: "home",
             location:
@@ -649,6 +650,10 @@ function App(props: { pair?: DialogPairCredentials }) {
                 ? (data.session.get(route.data.sessionID)?.location ?? location.ref)
                 : undefined,
           })
+          if (selection) {
+            local.model.set(selection)
+            local.model.variant.set(selection.variant)
+          }
           dialog.clear()
         },
       },