Skip to content

Commit 198cc1a

Browse files
committed
web: use manifest_hash and effective_url
1 parent 24a4717 commit 198cc1a

File tree

1 file changed

+24
-3
lines changed

1 file changed

+24
-3
lines changed

web/src/TacComponents.tsx

Lines changed: 24 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,8 @@ type Duration = {
115115
type UpstreamBundle = {
116116
compatible: string;
117117
version: string;
118+
manifest_hash: string;
119+
effective_url: string;
118120
newer_than_installed: boolean;
119121
};
120122

@@ -129,6 +131,11 @@ type Channel = {
129131
bundle?: UpstreamBundle;
130132
};
131133

134+
type UpdateRequest = {
135+
manifest_hash: string;
136+
url: string;
137+
};
138+
132139
interface SlotStatusProps {
133140
setCmdHint: (hint: React.ReactNode | null) => void;
134141
}
@@ -402,11 +409,16 @@ export function UpdateChannels(props: UpdateChannelsProps) {
402409
return "Up to date";
403410
}
404411

412+
const request: UpdateRequest = {
413+
manifest_hash: e.bundle.manifest_hash,
414+
url: e.bundle.effective_url,
415+
};
416+
405417
return (
406418
<MqttButton
407419
iconName="download"
408420
topic="/v1/tac/update/install"
409-
send={e.url}
421+
send={request}
410422
>
411423
Upgrade
412424
</MqttButton>
@@ -539,7 +551,16 @@ export function UpdateNotification() {
539551
if (channels !== undefined) {
540552
for (let ch of channels) {
541553
if (ch.enabled && ch.bundle && ch.bundle.newer_than_installed) {
542-
updates.push(ch);
554+
const request: UpdateRequest = {
555+
manifest_hash: ch.bundle.manifest_hash,
556+
url: ch.bundle.effective_url,
557+
};
558+
559+
updates.push({
560+
name: ch.name,
561+
display_name: ch.display_name,
562+
request: request,
563+
});
543564
}
544565
}
545566
}
@@ -549,7 +570,7 @@ export function UpdateNotification() {
549570
key={u.name}
550571
iconName="download"
551572
topic="/v1/tac/update/install"
552-
send={u.url}
573+
send={u.request}
553574
>
554575
Install new {u.display_name} bundle
555576
</MqttButton>

0 commit comments

Comments
 (0)