Use new js lib version

This commit is contained in:
Sacha Weatherstone
2022-12-30 22:14:29 +11:00
parent fca3719bce
commit acf2f9c3f4
26 changed files with 240 additions and 276 deletions
+16 -18
View File
@@ -65,25 +65,23 @@ export const Channel = ({ channel }: SettingsPanelProps): JSX.Element => {
const onSubmit = handleSubmit((data) => {
if (connection) {
void toast.promise(
connection.setChannel({
channel: {
role:
channel?.role === Protobuf.Channel_Role.PRIMARY
? Protobuf.Channel_Role.PRIMARY
: data.enabled
? Protobuf.Channel_Role.SECONDARY
: Protobuf.Channel_Role.DISABLED,
index: channel?.index,
settings: {
...data,
psk: toByteArray(data.psk ?? "")
connection
.setChannel({
channel: {
role:
channel?.role === Protobuf.Channel_Role.PRIMARY
? Protobuf.Channel_Role.PRIMARY
: data.enabled
? Protobuf.Channel_Role.SECONDARY
: Protobuf.Channel_Role.DISABLED,
index: channel?.index,
settings: {
...data,
psk: toByteArray(data.psk ?? "")
}
}
},
callback: (): Promise<void> => {
reset({ ...data });
return Promise.resolve();
}
}),
})
.then(() => reset({ ...data })),
{
loading: "Saving...",
success: "Saved Channel",