Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disable the Verify button/change the text during verification #40

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

piit79
Copy link

@piit79 piit79 commented Jan 24, 2024

When an OTA file is dropped into/selected in the file input, there is no visual feedback that the verification is in progress, which can be a bit confusing. This change improves that by disabling the "Verify OTA" button and changing the text to "Verifying, please wait..." during the verification process.

@luk1337
Copy link
Contributor

luk1337 commented Jan 24, 2024

There's a progress bar on the bottom of screen FYI when it's verifying.

@piit79 piit79 force-pushed the disable_verify_button_when_verifying branch from 9de5ac3 to 051e248 Compare January 24, 2024 15:50
@piit79
Copy link
Author

piit79 commented Jan 24, 2024

You're right, there is. But to be honest, I barely noticed it in Firefox as it's just a thin line at the very bottom of the screen...

@luk1337
Copy link
Contributor

luk1337 commented Jan 24, 2024

diff --git a/src/components/verify-tab/VerifyTabPage.vue b/src/components/verify-tab/VerifyTabPage.vue
index 284c755..eaa219a 100644
--- a/src/components/verify-tab/VerifyTabPage.vue
+++ b/src/components/verify-tab/VerifyTabPage.vue
@@ -84,7 +84,9 @@
           </tr>
         </table>
         <div class="flex justify-center mb-4">
-          <button class="btn px-4 py-1" @click="verifyClicked">Verify OTA package signature</button>
+          <button class="btn px-4 py-1" :disabled="anyLoading" @click="verifyClicked">
+            Verify OTA package signature
+          </button>
         </div>
         <form>
           <input class="hidden" type="file" ref="inputRef" @change="verifyFileInput" />
@@ -106,6 +108,11 @@ export default {
     fileName: '',
     isVerified: false
   }),
+  computed: {
+    anyLoading() {
+      return !!this.$store.getters.ongoingRequests
+    }
+  },
   methods: {
     fileDragOver(event) {
       event.currentTarget.classList.remove('border-opacity-0')

We can do this to disable the button alone.

@piit79
Copy link
Author

piit79 commented Jan 31, 2024

My main goal was to add the visual feedback. Disabling the button will prevent the user from clicking it again during the upload/verification, but it will not add any visual feedback.

Anyway, I can feel you're not a great fan of my change, and that's fine :) Feel free to implement at least the button disabling, or just close the PR.

@niclimcy
Copy link
Contributor

Selecting a file for verification does not upload any files anywhere, so I think it is fine to leave it as is? There isn't any scenario of a "partial upload" which is why most sites that upload your files disable the upload button.

Although I do agree that the loading bar could be more prominent

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants