mirror of
https://github.com/meshtastic/web.git
synced 2026-04-21 22:40:01 -04:00
Config saving behaviour change
This commit is contained in:
@@ -12,7 +12,7 @@ import { useDevice } from "@core/providers/useDevice.js";
|
||||
import { classValidatorResolver } from "@hookform/resolvers/class-validator";
|
||||
|
||||
export const Telemetry = (): JSX.Element => {
|
||||
const { moduleConfig, connection } = useDevice();
|
||||
const { moduleConfig, connection, setModuleConfig } = useDevice();
|
||||
const {
|
||||
register,
|
||||
handleSubmit,
|
||||
@@ -40,10 +40,14 @@ export const Telemetry = (): JSX.Element => {
|
||||
}
|
||||
}
|
||||
})
|
||||
.then(async () => {
|
||||
reset({ ...data });
|
||||
await Promise.resolve();
|
||||
}),
|
||||
.then(() =>
|
||||
setModuleConfig({
|
||||
payloadVariant: {
|
||||
oneofKind: "telemetry",
|
||||
telemetry: data
|
||||
}
|
||||
})
|
||||
),
|
||||
{
|
||||
loading: "Saving...",
|
||||
success: "Saved Telemetry Config, Restarting Node",
|
||||
|
||||
Reference in New Issue
Block a user