Update hosts form

This commit is contained in:
2026-09-20 12:51:12 +01:00
parent 8b40a876a1
commit a9ebd8fb75
13 changed files with 198 additions and 67 deletions
+7 -1
View File
@@ -13,6 +13,7 @@ import type { ImageInputToBase64FunctionReturn } from "../components/twui/utils/
import EJSON from "../utils/ejson";
import twuiSlugify from "../components/twui/utils/slugify";
import _ from "lodash";
import type { AppContextObject } from "../types";
type Params<T extends {} = BUN_SQLITE_WGUI_ALL_TYPEDEFS> = {
/**
@@ -46,6 +47,7 @@ type Params<T extends {} = BUN_SQLITE_WGUI_ALL_TYPEDEFS> = {
before_ready_function?: (params: {
form: T;
setForm: Dispatch<SetStateAction<T>>;
app_context: AppContextObject;
}) => Promise<void>;
};
@@ -111,7 +113,11 @@ export default function useFormInit<
} finally {
if (params?.before_ready_function) {
params
.before_ready_function({ form, setForm })
.before_ready_function({
form,
setForm,
app_context: appContext,
})
.then(() => {})
.catch((e2) => {
console.log(