fix(tui): restore forms on reconnect
Co-authored-by: opencode-agent[bot] <opencode-agent[bot]@users.noreply.github.com>
This commit is contained in:
parent
52ad916ba4
commit
9c54291ae8
3 changed files with 58 additions and 0 deletions
|
|
@ -1074,6 +1074,16 @@ export const { use: useData, provider: DataProvider } = createSimpleContext({
|
|||
)
|
||||
setStore("session", "permission", reconcile(permissions))
|
||||
}),
|
||||
sdk.api.form.listRequests({ location: locationQuery(defaultLocation()) }).then((response) => {
|
||||
const forms = mutable(response.data).reduce<Record<string, FormInfo[]>>(
|
||||
(result, form) => ({
|
||||
...result,
|
||||
[form.sessionID]: [...(result[form.sessionID] ?? []), form],
|
||||
}),
|
||||
{},
|
||||
)
|
||||
setStore("session", "form", reconcile(forms))
|
||||
}),
|
||||
result.location.refresh(),
|
||||
result.location.agent.refresh(),
|
||||
result.location.integration.refresh(),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue