Config saving behaviour change

This commit is contained in:
Sacha Weatherstone
2022-12-31 17:14:11 +11:00
parent f7fe27d621
commit ec25ec60ee
18 changed files with 227 additions and 103 deletions

View File

@@ -12,7 +12,7 @@ import { useDevice } from "@core/providers/useDevice.js";
import { classValidatorResolver } from "@hookform/resolvers/class-validator";
export const StoreForward = (): JSX.Element => {
const { moduleConfig, connection } = useDevice();
const { moduleConfig, connection, setModuleConfig } = useDevice();
const {
register,
handleSubmit,
@@ -40,7 +40,14 @@ export const StoreForward = (): JSX.Element => {
}
}
})
.then(() => reset({ ...data })),
.then(() =>
setModuleConfig({
payloadVariant: {
oneofKind: "storeForward",
storeForward: data
}
})
),
{
loading: "Saving...",
success: "Saved Store & Forward Config, Restarting Node",