Skip to content

Commit

Permalink
feat: disable submit button when click onced so as to prevent opening…
Browse files Browse the repository at this point in the history
… 2 shifts #309
  • Loading branch information
yrestom committed Jun 6, 2023
1 parent db45d27 commit bc12c77
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion posawesome/public/js/posapp/components/pos/OpeningDialog.vue
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,13 @@
<v-card-actions>
<v-spacer></v-spacer>
<v-btn color="error" dark @click="go_desk">Cancel</v-btn>
<v-btn color="success" dark @click="submit_dialog">Submit</v-btn>
<v-btn
color="success"
:disabled="is_loading"
dark
@click="submit_dialog"
>Submit</v-btn
>
</v-card-actions>
</v-card>
</v-dialog>
Expand All @@ -76,6 +82,7 @@ export default {
props: ['dialog'],
data: () => ({
dialog_data: {},
is_loading: false,
companys: [],
company: '',
pos_profiles_data: [],
Expand Down Expand Up @@ -155,6 +162,7 @@ export default {
if (!this.payments_methods.length || !this.company || !this.pos_profile) {
return;
}
this.is_loading = true;
const vm = this;
return frappe
.call('posawesome.posawesome.api.posapp.create_opening_voucher', {
Expand All @@ -167,6 +175,7 @@ export default {
evntBus.$emit('register_pos_data', r.message);
evntBus.$emit('set_company', r.message.company);
vm.close_opening_dialog();
is_loading = false;
}
});
},
Expand Down

0 comments on commit bc12c77

Please sign in to comment.