Skip to content

Commit

Permalink
fixes per comments
Browse files Browse the repository at this point in the history
  • Loading branch information
Ivanov N committed Dec 2, 2024
1 parent de37ad5 commit c3570a5
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 14 deletions.
2 changes: 1 addition & 1 deletion src/components/nodes/adm/AdmNodesTable.vue
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ export default defineComponent({
return admNodes.value.every(node => node.active)
},
set(value) {
store.dispatch('nodes/toggleAll', {nodesType: 'adm', active: value})
store.dispatch('nodes/toggleAll', { nodesType: 'adm', active: value })
}
})
Expand Down
2 changes: 1 addition & 1 deletion src/components/nodes/coins/CoinNodesTable.vue
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ export default defineComponent({
return nodes.value.every(node => node.active)
},
set(value) {
store.dispatch('nodes/toggleAll', {nodesType: 'coins', active: value})
store.dispatch('nodes/toggleAll', { nodesType: 'coins', active: value })
}
})
Expand Down
1 change: 1 addition & 0 deletions src/components/nodes/components/NodesTableHead.vue
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ export default {
type: Boolean
},
},
emits: ['update:modelValue'],
setup(props, { emit }) {
const { t } = useI18n()
Expand Down
11 changes: 5 additions & 6 deletions src/store/modules/nodes/nodes-actions.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,12 @@ export default {
},

toggleAll(context, payload) {
const {nodesType, active} = payload
const { nodesType, active } = payload
const nodes = context.getters[nodesType]
Object.keys(nodes).forEach(key => {
const node = nodes[key]
const {type, url} = node
context.dispatch('toggle', {type, url, active})
})
for (const node of Object.values(nodes)) {
const { type, url } = node
context.commit('toggle', { type, url, active })
}
},

setUseFastestAdmNode(context, payload) {
Expand Down
11 changes: 5 additions & 6 deletions src/store/modules/services/services-actions.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { services } from '@/lib/nodes/services'
import { ActionTree } from 'vuex'
import { RootState } from '@/store/types'
import { ServicesState, TogglePayload, ToggleAllPayload } from '@/store/modules/services/types'
import { ServicesState, TogglePayload, ToggleAllPayload, Node } from '@/store/modules/services/types'

export const actions: ActionTree<ServicesState, RootState> = {
updateStatus() {
Expand All @@ -17,11 +17,10 @@ export const actions: ActionTree<ServicesState, RootState> = {
toggleAll(context, payload: ToggleAllPayload) {
const { active } = payload
const nodes = context.getters['services']
Object.keys(nodes).forEach(key => {
const node = nodes[key]
const { label, url } = node
context.dispatch('toggle', {type: label, url, active})
})
for (const node of Object.values(nodes)) {
const { label, url } = node as Node
context.commit('toggle', { type: label, url, active })
}
},

useFastestService(context, payload: boolean) {
Expand Down
1 change: 1 addition & 0 deletions src/store/modules/services/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,4 @@ export type StatusPayload = {
}
export type TogglePayload = { type: AvailableService; url: string; active: boolean }
export type ToggleAllPayload = { active: boolean }
export type Node = { label: string, url: string }

0 comments on commit c3570a5

Please sign in to comment.