mirror of
https://gitea.toothfairyai.com/ToothFairyAI/tf_code.git
synced 2026-04-11 19:28:33 +00:00
tui: fix continue session navigation to wait for sync completion before redirecting
Previously, the continue session navigation would immediately try to redirect to the most recent session before the sync data was fully loaded, causing navigation to fail. Now it waits for sync status to be complete before attempting the redirect, ensuring the session data is available.
This commit is contained in:
@@ -176,15 +176,6 @@ function App() {
|
||||
})
|
||||
local.model.set({ providerID, modelID }, { recent: true })
|
||||
}
|
||||
if (args.continue) {
|
||||
const match = sync.data.session.at(0)?.id
|
||||
if (match) {
|
||||
route.navigate({
|
||||
type: "session",
|
||||
sessionID: match,
|
||||
})
|
||||
}
|
||||
}
|
||||
if (args.sessionID) {
|
||||
route.navigate({
|
||||
type: "session",
|
||||
@@ -194,6 +185,19 @@ function App() {
|
||||
})
|
||||
})
|
||||
|
||||
createEffect(() => {
|
||||
if (sync.status !== "complete") return
|
||||
if (args.continue) {
|
||||
const match = sync.data.session.at(0)?.id
|
||||
if (match) {
|
||||
route.navigate({
|
||||
type: "session",
|
||||
sessionID: match,
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
command.register(() => [
|
||||
{
|
||||
title: "Switch session",
|
||||
|
||||
Reference in New Issue
Block a user