Compat with latest JS lib
This commit is contained in:
@@ -49,27 +49,27 @@ export const ImportDialog = ({
|
||||
|
||||
const apply = () => {
|
||||
channelSet?.settings.map((ch, index) => {
|
||||
connection?.setChannel({
|
||||
channel: {
|
||||
connection?.setChannel(
|
||||
new Protobuf.Channel({
|
||||
index,
|
||||
role:
|
||||
index === 0
|
||||
? Protobuf.Channel_Role.PRIMARY
|
||||
: Protobuf.Channel_Role.SECONDARY,
|
||||
settings: ch
|
||||
}
|
||||
});
|
||||
})
|
||||
);
|
||||
});
|
||||
|
||||
if (channelSet?.loraConfig) {
|
||||
connection?.setConfig({
|
||||
config: {
|
||||
connection?.setConfig(
|
||||
new Protobuf.Config({
|
||||
payloadVariant: {
|
||||
oneofKind: "lora",
|
||||
lora: channelSet.loraConfig
|
||||
case: "lora",
|
||||
value: channelSet.loraConfig
|
||||
}
|
||||
}
|
||||
});
|
||||
})
|
||||
);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -32,13 +32,13 @@ export const QRDialog = ({
|
||||
.filter((channel) => selectedChannels.includes(channel.index))
|
||||
.map((channel) => channel.settings)
|
||||
.filter((ch): ch is Protobuf.ChannelSettings => !!ch);
|
||||
const encoded = Protobuf.ChannelSet.toBinary(
|
||||
Protobuf.ChannelSet.create({
|
||||
const encoded = new Protobuf.ChannelSet(
|
||||
new Protobuf.ChannelSet({
|
||||
loraConfig,
|
||||
settings: channelsToEncode
|
||||
})
|
||||
);
|
||||
const base64 = fromByteArray(encoded)
|
||||
const base64 = fromByteArray(encoded.toBinary())
|
||||
.replace(/=/g, "")
|
||||
.replace(/\+/g, "-")
|
||||
.replace(/\//g, "_");
|
||||
|
||||
@@ -37,9 +37,7 @@ export const RebootDialog = ({
|
||||
icon: <ClockIcon className="w-4" />,
|
||||
action() {
|
||||
connection
|
||||
?.reboot({
|
||||
time: time * 60
|
||||
})
|
||||
?.reboot(time * 60)
|
||||
.then(() => setRebootDialogOpen(false));
|
||||
}
|
||||
}}
|
||||
@@ -48,11 +46,7 @@ export const RebootDialog = ({
|
||||
className="w-24"
|
||||
iconBefore={<ArrowPathIcon className="w-4" />}
|
||||
onClick={() => {
|
||||
connection
|
||||
?.reboot({
|
||||
time: 0
|
||||
})
|
||||
.then(() => setRebootDialogOpen(false));
|
||||
connection?.reboot(2).then(() => setRebootDialogOpen(false));
|
||||
}}
|
||||
>
|
||||
Now
|
||||
|
||||
@@ -37,9 +37,7 @@ export const ShutdownDialog = ({
|
||||
icon: <ClockIcon className="w-4" />,
|
||||
action() {
|
||||
connection
|
||||
?.shutdown({
|
||||
time: time * 60
|
||||
})
|
||||
?.shutdown(time * 60)
|
||||
.then(() => setShutdownDialogOpen(false));
|
||||
}
|
||||
}}
|
||||
@@ -48,11 +46,7 @@ export const ShutdownDialog = ({
|
||||
className="w-24"
|
||||
iconBefore={<PowerIcon className="w-4" />}
|
||||
onClick={() => {
|
||||
connection
|
||||
?.shutdown({
|
||||
time: 0
|
||||
})
|
||||
.then(() => setShutdownDialogOpen(false));
|
||||
connection?.shutdown(2).then(() => setShutdownDialogOpen(false));
|
||||
}}
|
||||
>
|
||||
Now
|
||||
|
||||
Reference in New Issue
Block a user