curl.lib.js icon indicating copy to clipboard operation
curl.lib.js copied to clipboard

Remove method uses wrong JS method

Open obany opened this issue 8 years ago • 1 comments

The library remove method uses unshift, which is for adding to a list.

https://github.com/iotaledger/curl.lib.js/blob/2da1de36123d89b0c7dcababe24f72828bc5f794/src/curl.lib.js#L168

This should be either be shift() if you are trying to remove the current job, or pop() if you are trying to remove the last added item.

obany avatar Feb 09 '18 09:02 obany

That's right. Using the unshift-method without parameters just returns the last element of the array which is most likely not the intended behaviour here.

laubsauger avatar Mar 28 '18 15:03 laubsauger