diff --git a/src/components/dialogs/SpoolmanEjectSpoolDialog.vue b/src/components/dialogs/SpoolmanEjectSpoolDialog.vue index 14200f2a0..479ef136f 100644 --- a/src/components/dialogs/SpoolmanEjectSpoolDialog.vue +++ b/src/components/dialogs/SpoolmanEjectSpoolDialog.vue @@ -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() } } diff --git a/src/store/server/spoolman/actions.ts b/src/store/server/spoolman/actions.ts index c6aa30ee5..510c23c75 100644 --- a/src/store/server/spoolman/actions.ts +++ b/src/store/server/spoolman/actions.ts @@ -112,9 +112,10 @@ export const actions: ActionTree = { }, 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 }) {