mirror of
https://github.com/meshtastic/web.git
synced 2026-04-21 22:40:01 -04:00
Compat with latest JS lib
This commit is contained in:
@@ -10,6 +10,7 @@ import { ExternalNotificationValidation } from "@app/validation/moduleConfig/ext
|
||||
import { Form } from "@components/form/Form";
|
||||
import { useDevice } from "@core/providers/useDevice.js";
|
||||
import { classValidatorResolver } from "@hookform/resolvers/class-validator";
|
||||
import { Protobuf } from "@meshtastic/meshtasticjs";
|
||||
|
||||
export const ExternalNotification = (): JSX.Element => {
|
||||
const { moduleConfig, connection, setModuleConfig } = useDevice();
|
||||
@@ -31,21 +32,23 @@ export const ExternalNotification = (): JSX.Element => {
|
||||
if (connection) {
|
||||
void toast.promise(
|
||||
connection
|
||||
.setModuleConfig({
|
||||
moduleConfig: {
|
||||
.setModuleConfig(
|
||||
new Protobuf.ModuleConfig({
|
||||
payloadVariant: {
|
||||
oneofKind: "externalNotification",
|
||||
externalNotification: data
|
||||
}
|
||||
}
|
||||
})
|
||||
.then(() =>
|
||||
setModuleConfig({
|
||||
payloadVariant: {
|
||||
oneofKind: "externalNotification",
|
||||
externalNotification: data
|
||||
case: "externalNotification",
|
||||
value: data
|
||||
}
|
||||
})
|
||||
)
|
||||
.then(() =>
|
||||
setModuleConfig(
|
||||
new Protobuf.ModuleConfig({
|
||||
payloadVariant: {
|
||||
case: "externalNotification",
|
||||
value: data
|
||||
}
|
||||
})
|
||||
)
|
||||
),
|
||||
{
|
||||
loading: "Saving...",
|
||||
|
||||
Reference in New Issue
Block a user