Skip to content

Commit

Permalink
Disable verify button during signature verification
Browse files Browse the repository at this point in the history
  • Loading branch information
luk1337 committed Jul 29, 2024
1 parent e2dcfe7 commit 89f559e
Showing 1 changed file with 21 additions and 4 deletions.
25 changes: 21 additions & 4 deletions src/components/verify-tab/VerifyTabPage.vue
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,14 @@
</tr>
</table>
<div class="mb-4 flex justify-center">
<button class="btn px-4 py-1" @click="verifyClicked">Verify OTA package signature</button>
<button
class="btn px-4 py-1"
:class="{ 'opacity-50': isVerifying }"
:disabled="isVerifying"
@click="verifyClicked"
>
Verify OTA package signature
</button>
</div>
<form>
<input class="hidden" type="file" ref="inputRef" @change="verifyFileInput" />
Expand All @@ -104,7 +111,8 @@ export default {
verifyResult: '',
verifySignInfo: null,
fileName: '',
isVerified: false
isVerified: false,
isVerifying: false
}),
methods: {
fileDragOver(event) {
Expand Down Expand Up @@ -136,13 +144,22 @@ export default {
this.verifyResult = result.msg
this.verifySignInfo = result.signInfo
}
fileReader.onloadstart = () => store.commit('startRequest')
fileReader.onloadend = () => store.commit('endRequest')
fileReader.onloadstart = () => (this.isVerifying = true)
fileReader.onloadend = () => (this.isVerifying = false)
fileReader.readAsArrayBuffer(blob)
},
verifyFileInput(event) {
this.verifyFile(event.currentTarget.files[0])
}
},
watch: {
isVerifying: function (val) {
if (val) {
store.commit('startRequest')
} else {
store.commit('endRequest')
}
}
}
}
</script>

0 comments on commit 89f559e

Please sign in to comment.