Skip to content

Commit

Permalink
fix: send empty object to eject spool
Browse files Browse the repository at this point in the history
Signed-off-by: Stefan Dej <[email protected]>
  • Loading branch information
meteyou committed Oct 17, 2023
1 parent 7ef52b5 commit 674cec2
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/components/dialogs/SpoolmanEjectSpoolDialog.vue
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ export default class SpoolmanEjectSpoolDialog extends Mixins(BaseMixin) {
}
removeSpool() {
this.$store.dispatch('server/spoolman/setActiveSpool', 0)
this.$store.dispatch('server/spoolman/setActiveSpool', null)
this.close()
}
}
Expand Down
7 changes: 4 additions & 3 deletions src/store/server/spoolman/actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -112,9 +112,10 @@ export const actions: ActionTree<ServerSpoolmanState, RootState> = {
},

setActiveSpool(_, id: number | null) {
Vue.$socket.emit('server.spoolman.post_spool_id', {
spool_id: id,
})
const params: { spool_id?: number } = {}
if (id !== null) params['spool_id'] = id

Vue.$socket.emit('server.spoolman.post_spool_id', params)
},

refreshActiveSpool({ state }) {
Expand Down

0 comments on commit 674cec2

Please sign in to comment.