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

LIMS-210: Prevent double clicking to create multiple samples #660

Merged
merged 2 commits into from
Sep 6, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion client/src/js/app/store/store.js
Original file line number Diff line number Diff line change
Expand Up @@ -367,7 +367,8 @@ const store = new Vuex.Store({
oidcId: state => state.auth.oidcId,
apiUrl: state => state.apiUrl,
appUrl: state => state.appUrl,
getAppOptions: state => state.appOptions
getAppOptions: state => state.appOptions,
isLoading: state => state.isLoading,
}
})

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -318,14 +318,16 @@ export default {
// Save the sample to the server via backbone model
// Location should be the sample LOCATION
async onSaveSample(location) {
try {
if (this.$store.getters.isLoading) { // avoid double click
return
}
try {
this.$store.commit('loading', true)
const result = await this.$refs.containerForm.validate()

if (result) {
await this.saveSample(location)
ndg63276 marked this conversation as resolved.
Show resolved Hide resolved
const samplesRef = this.$refs.samples
samplesRef.$refs[`sample-row-${location}`][0].closeSampleEditing()
samplesRef.$refs[`sample-row-${location}`][0].closeSampleEditing()
this.$refs.containerForm.reset()
}
else {
Expand Down
Loading