Removed spell queue (#10337)
This commit is contained in:
@@ -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 };
|
||||
@@ -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 = {};
|
||||
|
||||
Reference in New Issue
Block a user