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
@@ -15,7 +15,7 @@ import { classValidatorResolver } from "@hookform/resolvers/class-validator";
import { Protobuf } from "@meshtastic/meshtasticjs";
export const Position = (): JSX.Element => {
const { config, connection, nodes, hardware } = useDevice();
const { config, connection, nodes, hardware, setConfig } = useDevice();
const myNode = nodes.find((n) => n.data.num === hardware.myNodeNum);
@@ -86,7 +86,14 @@ export const Position = (): JSX.Element => {
}
}
})
.then(() => reset({ ...data })),
.then(() =>
setConfig({
payloadVariant: {
oneofKind: "position",
position: data
}
})
),
{
loading: "Saving...",
success: "Saved Position Config, Restarting Node",