fix(tui): surface child session forms
This commit is contained in:
parent
ae8a591426
commit
bb9a34a9f4
2 changed files with 12 additions and 6 deletions
|
|
@ -398,8 +398,7 @@ function FieldsPrompt(props: { form: FormInfo & { mode: "form" } }) {
|
|||
cmd: () => {
|
||||
if (!textual()) return
|
||||
const text = textarea?.plainText?.trim() ?? ""
|
||||
if (text) submitText(text)
|
||||
if (!text) selectTab((store.tab + 1) % tabs())
|
||||
submitText(text)
|
||||
},
|
||||
},
|
||||
{
|
||||
|
|
@ -409,8 +408,7 @@ function FieldsPrompt(props: { form: FormInfo & { mode: "form" } }) {
|
|||
cmd: () => {
|
||||
if (!textual()) return
|
||||
const text = textarea?.plainText?.trim() ?? ""
|
||||
if (text) submitText(text, -1)
|
||||
if (!text) selectTab((store.tab - 1 + tabs()) % tabs())
|
||||
submitText(text, -1)
|
||||
},
|
||||
},
|
||||
{
|
||||
|
|
|
|||
|
|
@ -188,7 +188,10 @@ export function Session() {
|
|||
})
|
||||
const forms = createMemo(() => {
|
||||
if (session()?.parentID) return []
|
||||
return [...(data.session.form.list(route.sessionID) ?? []), ...(data.session.form.list("global") ?? [])]
|
||||
return [
|
||||
...[route.sessionID, ...descendantSessionIDs()].flatMap((sessionID) => data.session.form.list(sessionID) ?? []),
|
||||
...(data.session.form.list("global") ?? []),
|
||||
]
|
||||
})
|
||||
const [composer, setComposer] = createStore({
|
||||
open: false,
|
||||
|
|
@ -241,7 +244,12 @@ export function Session() {
|
|||
|
||||
createEffect(
|
||||
on(descendantSessionIDs, (sessionIDs) => {
|
||||
void Promise.all(sessionIDs.map((sessionID) => data.session.permission.refresh(sessionID)))
|
||||
void Promise.all(
|
||||
sessionIDs.flatMap((sessionID) => [
|
||||
data.session.permission.refresh(sessionID),
|
||||
data.session.form.refresh(sessionID),
|
||||
]),
|
||||
)
|
||||
}),
|
||||
)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue