fix(tui): restore legacy sync consumers (#31908)
This commit is contained in:
parent
2bde20c2ba
commit
567d6ed1a3
8 changed files with 97 additions and 97 deletions
|
|
@ -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
|
||||
})
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue