From 3115b3cc28bf4850eab7eaf1f4d2e932b61fc210 Mon Sep 17 00:00:00 2001 From: Mike Fix Date: Wed, 6 Feb 2019 17:00:00 -0800 Subject: [PATCH] fix debounce for tweet and image api calls --- lib/api.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/api.js b/lib/api.js index acb65b0..f9920ef 100644 --- a/lib/api.js +++ b/lib/api.js @@ -18,7 +18,7 @@ const gistClient = axios.create({ } }) -async function tweet(content, encodedImage) { +function tweet(content, encodedImage) { const processedData = encodedImage.split(',')[1] return client @@ -70,6 +70,6 @@ function checkIfRateLimited(err) { export default { client, getGist, - tweet: debounce(tweet, ms('5s'), { leading: true, trailing: true }), - image: debounce(image, ms('5s'), { leading: true, trailing: true }) + tweet: debounce(tweet, ms('5s'), { leading: true, trailing: false }), + image: debounce(image, ms('5s'), { leading: true, trailing: false }) }