Removed spell queue (#10337)

This commit is contained in:
Keith Holliday
2018-05-06 17:53:49 -05:00
committed by GitHub
parent f226b5da07
commit ac451bdb9b
2 changed files with 0 additions and 46 deletions
-40
View File
@@ -1,40 +0,0 @@
let store = {};
let currentCount = 1;
let currentSpell = {
key: '',
};
let timer = null;
// @TODO: We are using this lib in actions, so we have to inject store
function setStore (storeInc) {
store = storeInc;
}
function castSpell () {
clearTimeout(timer);
currentSpell.quantity = currentCount;
store.dispatch('user:castSpell', currentSpell);
currentCount = 0;
}
function queue (spell, storeInc) {
setStore(storeInc);
currentCount += 1;
if (currentSpell.key && spell.key !== currentSpell.key) {
castSpell();
}
currentSpell = spell;
clearTimeout(timer);
timer = setTimeout(() => {
castSpell();
}, 1500);
}
export default { queue };
-6
View File
@@ -1,5 +1,4 @@
import { loadAsyncResource } from 'client/libs/asyncResource';
import spellQueue from 'client/libs/spellQueue';
import setProps from 'lodash/set';
import axios from 'axios';
@@ -118,11 +117,6 @@ export async function movePinnedItem (store, params) {
}
export function castSpell (store, params) {
if (params.pinType !== 'card' && !params.quantity) {
spellQueue.queue({key: params.key, targetId: params.targetId}, store);
return;
}
let spellUrl = `/api/v3/user/class/cast/${params.key}`;
const data = {};