fix(tui): preserve session location during handoff (#39886)
This commit is contained in:
parent
d07d9ae0da
commit
1311d909a7
4 changed files with 112 additions and 2 deletions
|
|
@ -646,7 +646,10 @@ function App(props: { pair?: DialogPairCredentials }) {
|
|||
run: () => {
|
||||
route.navigate({
|
||||
type: "home",
|
||||
location: route.data.type === "session" ? data.session.get(route.data.sessionID)?.location : undefined,
|
||||
location:
|
||||
route.data.type === "session"
|
||||
? (data.session.get(route.data.sessionID)?.location ?? location.ref)
|
||||
: undefined,
|
||||
})
|
||||
dialog.clear()
|
||||
},
|
||||
|
|
|
|||
|
|
@ -84,6 +84,7 @@ export function DialogOpen() {
|
|||
value: { type: "session", sessionID: session.id } as OpenTarget,
|
||||
category: "Sessions",
|
||||
footer: `${name ? `${Locale.truncate(name, 20)} · ` : ""}${timeAgo(session.time.updated)}`,
|
||||
onSelect: () => location.set(session.location),
|
||||
gutter: running
|
||||
? () => <Spinner />
|
||||
: tabs.has(session.id)
|
||||
|
|
|
|||
|
|
@ -143,8 +143,8 @@ export function Session() {
|
|||
const promptRef = usePromptRef()
|
||||
const session = createMemo(() => data.session.get(route.sessionID))
|
||||
const messages = () => data.session.message.list(route.sessionID)
|
||||
const location = createMemo(() => session()?.location)
|
||||
const currentLocation = useLocation()
|
||||
const location = createMemo(() => session()?.location ?? currentLocation.ref)
|
||||
|
||||
createEffect(() => currentLocation.set(location()))
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue