Skip to content

Commit 534bd9a

Browse files
committed
Clean up
1 parent b5d16d1 commit 534bd9a

2 files changed

Lines changed: 7 additions & 6 deletions

File tree

examples/api/src/views/Updater.svelte

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,11 @@
77
let isChecking = $state(false)
88
let isInstalling = $state(false)
99
let newUpdate: Update = $state()
10-
let totalSize = 0,
11-
downloadedSize = 0
10+
let totalSize = $state(0)
11+
let downloadedSize = $state(0)
12+
let progress = $derived(
13+
totalSize ? Math.round((downloadedSize / totalSize) * 100) : 0
14+
)
1215
1316
async function checkUpdate() {
1417
isChecking = true
@@ -55,8 +58,6 @@
5558
isInstalling = false
5659
}
5760
}
58-
59-
let progress = $derived(totalSize ? Math.round((downloadedSize / totalSize) * 100) : 0)
6061
</script>
6162

6263
<div class="flex children:grow children:h10">

plugins/updater/src/updater.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1503,7 +1503,7 @@ where
15031503
}
15041504

15051505
// Validate signature
1506-
fn verify_signature(data: &[u8], release_signature: &str, pub_key: &str) -> Result<bool> {
1506+
fn verify_signature(data: &[u8], release_signature: &str, pub_key: &str) -> Result<()> {
15071507
// we need to convert the pub key
15081508
let pub_key_decoded = base64_to_string(pub_key)?;
15091509
let public_key = PublicKey::decode(&pub_key_decoded)?;
@@ -1512,7 +1512,7 @@ fn verify_signature(data: &[u8], release_signature: &str, pub_key: &str) -> Resu
15121512

15131513
// Validate signature or bail out
15141514
public_key.verify(data, &signature, true)?;
1515-
Ok(true)
1515+
Ok(())
15161516
}
15171517

15181518
fn base64_to_string(base64_string: &str) -> Result<String> {

0 commit comments

Comments
 (0)