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

@@ -15,7 +15,7 @@ import { classValidatorResolver } from "@hookform/resolvers/class-validator";
import { Protobuf } from "@meshtastic/meshtasticjs";
export const CannedMessage = (): JSX.Element => {
const { moduleConfig, connection } = useDevice();
const { moduleConfig, connection, setModuleConfig } = useDevice();
const {
register,
handleSubmit,
@@ -49,7 +49,14 @@ export const CannedMessage = (): JSX.Element => {
}
}
})
.then(() => reset({ ...data })),
.then(() =>
setModuleConfig({
payloadVariant: {
oneofKind: "cannedMessage",
cannedMessage: data
}
})
),
{
loading: "Saving...",
success: "Saved Canned Message Config, Restarting Node",