Skip to content

Commit

Permalink
Improved: single imports, reverted unwanted changes, and update commi…
Browse files Browse the repository at this point in the history
…t for updating barcode preference (#325)
  • Loading branch information
amansinghbais committed Jul 18, 2024
1 parent 9018478 commit 534e12a
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 8 deletions.
5 changes: 2 additions & 3 deletions src/store/modules/util/actions.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
import { ActionTree } from 'vuex'
import RootState from '@/store/RootState'
import * as types from './mutation-types'
import { hasError } from '@/utils'
import { hasError, showToast } from '@/utils'
import UtilState from './UtilState'
import { UtilService } from '@/services/UtilService'
import store from '@/store';
import { showToast } from '@/utils'
import { translate } from '@hotwax/dxp-components'

const actions: ActionTree<UtilState, RootState> = {
Expand Down Expand Up @@ -283,7 +282,7 @@ const actions: ActionTree<UtilState, RootState> = {
},

async updateBarcodeIdentificationPref({ commit }, payload) {
commit(types.UTIL_FORCE_SCAN_STATUS_UPDATED, payload)
commit(types.UTIL_BARCODE_IDENTIFICATION_PREF_UPDATED, payload)
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/store/modules/util/getters.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { GetterTree } from 'vuex'
import RootState from '../../RootState'
import RootState from '@/store/RootState'
import UtilState from './UtilState';

const getters: GetterTree <UtilState, RootState> = {
Expand Down
4 changes: 0 additions & 4 deletions src/views/Settings.vue
Original file line number Diff line number Diff line change
Expand Up @@ -226,10 +226,6 @@ export default defineComponent({
this.store.dispatch('user/setProductIdentificationPref', { id, value })
},
setBarcodeIdentificationPref(value: string) {
// Not dispatching an action if the value for id is same as saved in state
if(this.barcodeIdentificationPref == value) {
return;
}
this.store.dispatch('util/setBarcodeIdentificationPref', value)
},
getDateTime(time: any) {
Expand Down

0 comments on commit 534e12a

Please sign in to comment.