fix(tui): restore legacy sync consumers (#31908)

This commit is contained in:
Dax 2026-06-11 11:01:20 -04:00 committed by GitHub
commit 567d6ed1a3
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
8 changed files with 97 additions and 97 deletions

View file

@ -4,20 +4,19 @@ import { createMemo, Match, Show, Switch } from "solid-js"
import { abbreviateHome } from "../../runtime"
import { useTuiPaths } from "../../context/runtime"
import { useHomeSessionDestination } from "../../routes/home/session-destination"
import { useData } from "../../context/data"
const id = "internal:home-footer"
function Directory(props: { api: TuiPluginApi }) {
const theme = () => props.api.theme.current
const destination = useHomeSessionDestination()
const data = useData()
const paths = useTuiPaths()
const dir = createMemo(() => {
const selected = destination?.destination()
const directory = !selected || selected.type === "new" ? data.location.default().directory : selected.directory
const out = abbreviateHome(directory, paths.home)
const branch = directory === (props.api.state.path.directory || paths.cwd) ? props.api.state.vcs?.branch : undefined
if (!selected || selected.type === "new") return
const out = abbreviateHome(selected.directory, paths.home)
const branch =
selected.directory === (props.api.state.path.directory || paths.cwd) ? props.api.state.vcs?.branch : undefined
if (branch) return out + ":" + branch
return out
})