From 440376e5c3d2ac357acddfb696984b675121b0d9 Mon Sep 17 00:00:00 2001 From: ntr Date: Mon, 10 Jun 2019 21:53:38 +1000 Subject: [PATCH] fix stuff n tings --- client/src/events.jsx | 13 +++++++++++++ client/src/socket.jsx | 7 +++++-- 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/client/src/events.jsx b/client/src/events.jsx index 1e5a20f5..8f45df49 100644 --- a/client/src/events.jsx +++ b/client/src/events.jsx @@ -113,6 +113,18 @@ function registerEvents(store) { console.log('event clear item'); } + function clearInstance() { + store.dispatch(actions.setCombiner([null, null, null])); + store.dispatch(actions.setReclaiming(false)); + store.dispatch(actions.setActiveSkill(null)); + store.dispatch(actions.setActiveConstruct(null)); + store.dispatch(actions.setInfo(null)); + store.dispatch(actions.setItemEquip(null)); + store.dispatch(actions.setItemUnequip(null)); + store.dispatch(actions.setVboxHighlight([])); + store.dispatch(actions.setConstructDeleteId(null)); + } + function setAccountInstances(v) { return store.dispatch(actions.setInstances(v)); } @@ -187,6 +199,7 @@ function registerEvents(store) { return { errorPrompt, clearCombiner, + clearInstance, setAccount, setActiveSkill, setActiveItem, diff --git a/client/src/socket.jsx b/client/src/socket.jsx index b4a9d826..b8a114d7 100644 --- a/client/src/socket.jsx +++ b/client/src/socket.jsx @@ -81,20 +81,22 @@ function createSocket(events) { function sendVboxAccept(instanceId, group, index) { send({ method: 'vbox_accept', params: { instance_id: instanceId, group, index } }); + events.clearInstance(); } function sendVboxApply(instanceId, constructId, index) { send({ method: 'vbox_apply', params: { instance_id: instanceId, construct_id: constructId, index } }); - events.setActiveItem(null); + events.clearInstance(); } function sendVboxUnequip(instanceId, constructId, target) { send({ method: 'vbox_unequip', params: { instance_id: instanceId, construct_id: constructId, target } }); - events.clearInfo(); + events.clearInstance(); } function sendVboxDiscard(instanceId) { send({ method: 'vbox_discard', params: { instance_id: instanceId } }); + events.clearInstance(); } function sendVboxCombine(instanceId, indices) { @@ -104,6 +106,7 @@ function createSocket(events) { function sendVboxReclaim(instanceId, index) { send({ method: 'vbox_reclaim', params: { instance_id: instanceId, index } }); + events.clearInstance(); } function sendItemInfo() {