fix(app): navigate to tabs when opening file
This commit is contained in:
parent
3297e5230e
commit
eac2d4c699
2 changed files with 29 additions and 3 deletions
|
|
@ -26,7 +26,7 @@ type Entry = {
|
|||
|
||||
type DialogSelectFileMode = "all" | "files"
|
||||
|
||||
export function DialogSelectFile(props: { mode?: DialogSelectFileMode }) {
|
||||
export function DialogSelectFile(props: { mode?: DialogSelectFileMode; onOpenFile?: (path: string) => void }) {
|
||||
const command = useCommand()
|
||||
const language = useLanguage()
|
||||
const layout = useLayout()
|
||||
|
|
@ -164,6 +164,7 @@ export function DialogSelectFile(props: { mode?: DialogSelectFileMode }) {
|
|||
tabs().open(value)
|
||||
file.load(path)
|
||||
view().reviewPanel.open()
|
||||
props.onOpenFile?.(path)
|
||||
}
|
||||
|
||||
const handleSelect = (item: Entry | undefined) => {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue