Skip to content

Commit

Permalink
use form submit
Browse files Browse the repository at this point in the history
  • Loading branch information
radek00 committed Oct 18, 2023
1 parent a764b64 commit 3b6cc63
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 10 deletions.
2 changes: 1 addition & 1 deletion SecureSend/ClientApp/src/views/FileDownloadView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ const isPasswordValidComputed = computed(
errorMessage="Invalid password"
></SimpleInput>
</div>
<StyledButton @click="verifyPassword()" :type="ButtonType.primary"
<StyledButton @click="verifyPassword()" :category="ButtonType.primary"
>Unlock</StyledButton
>
</div>
Expand Down
20 changes: 11 additions & 9 deletions SecureSend/ClientApp/src/views/FileUploadView.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<template>
<div
<form
@submit="onSubmit"
class="w-11/12 lg:w-6/12 flex flex-col justify-between gap-4 h-11/12 p-6 border rounded-lg shadow bg-gray-800 border-gray-800"
>
<FormStepper class="px-[10px]" :step="step"></FormStepper>
Expand All @@ -12,7 +13,6 @@
:style="{ transform }"
>
<SchemaInput
@keyup.enter="onSubmit"
name="password"
type="password"
label="Encryption password"
Expand All @@ -30,7 +30,6 @@
>
<SchemaInput
:tabindex="step !== 1 ? -1 : 0"
@keyup.enter="onSubmit"
name="expiryDate"
type="date"
label="Expiry date"
Expand Down Expand Up @@ -61,25 +60,27 @@
>
<div class="flex gap-3 flex-col md:flex-row w-full md:w-auto md:gap-2">
<StyledButton
type="button"
class="w-full md:w-auto"
:type="ButtonType.primary"
:category="ButtonType.primary"
:disabled="step === 0 || isLoading || isUploadSetup"
@click="step -= 1"
>Back</StyledButton
>
<StyledButton
type="button"
:disabled="(step === 0 && !meta.dirty) || isLoading"
:type="ButtonType.cancel"
:category="ButtonType.cancel"
class="w-full md:w-auto"
@click="formReset()"
>Reset</StyledButton
>
</div>
<StyledButton
class="w-full md:w-auto"
:type="ButtonType.primary"
:category="ButtonType.primary"
:disabled="!meta.valid || isLoading"
@click="onSubmit()"
type="submit"
>
<span class="flex items-center justify-center">
{{ step < 2 ? "Next" : "Upload" }}
Expand All @@ -90,7 +91,7 @@
</span>
</StyledButton>
</div>
</div>
</form>
<ConfirmModalVue v-if="isRevealed" @close-click="confirm(true)">
<template #header>Share your files</template>
<template #body>
Expand All @@ -101,7 +102,7 @@
></SimpleInput>
</template>
<template #footer>
<StyledButton @click="copyToClipboard()" :type="ButtonType.primary"
<StyledButton @click="copyToClipboard()" :category="ButtonType.primary"
>Copy to clipboard</StyledButton
>
</template>
Expand Down Expand Up @@ -264,6 +265,7 @@ const handlePause = async (file: File) => {
//events
const onSubmit = handleSubmit(async () => {
console.log("triggered");
if (step.value === 2) {
isLoading!.value = true;
if (!isUploadSetup.value) {
Expand Down

0 comments on commit 3b6cc63

Please sign in to comment.