refactor(tui): extract standalone package (#31193)
This commit is contained in:
@@ -8,7 +8,7 @@ import {
|
||||
type Setter,
|
||||
} from "solid-js"
|
||||
import { useSync } from "../../context/sync"
|
||||
import { useTuiEnvironment } from "../../runtime"
|
||||
import { useTuiPaths } from "../../context/runtime"
|
||||
|
||||
export type HomeSessionDestination = { type: "directory"; directory: string; subdirectory: boolean } | { type: "new" }
|
||||
|
||||
@@ -22,10 +22,10 @@ const HomeSessionDestinationContext = createContext<Context>()
|
||||
|
||||
export function HomeSessionDestinationProvider(props: ParentProps) {
|
||||
const sync = useSync()
|
||||
const environment = useTuiEnvironment()
|
||||
const paths = useTuiPaths()
|
||||
const [selected, setDestination] = createSignal<HomeSessionDestination>()
|
||||
const destination = createMemo<HomeSessionDestination>(
|
||||
() => selected() ?? { type: "directory", directory: sync.path.directory || environment.cwd, subdirectory: false },
|
||||
() => selected() ?? { type: "directory", directory: sync.path.directory || paths.cwd, subdirectory: false },
|
||||
)
|
||||
return (
|
||||
<HomeSessionDestinationContext.Provider
|
||||
|
||||
Reference in New Issue
Block a user