From 3d079f7e7e015daf6e13120cf53d3f6e1b92235f Mon Sep 17 00:00:00 2001 From: ccd0 Date: Sat, 3 Aug 2019 08:56:40 -0700 Subject: [PATCH] Remove obsolete Recaptcha v1 code and remove dependence on findIndex. --- src/Posting/Captcha.cache.coffee | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/Posting/Captcha.cache.coffee b/src/Posting/Captcha.cache.coffee index 8d245e8f5..e51fc2f75 100644 --- a/src/Posting/Captcha.cache.coffee +++ b/src/Posting/Captcha.cache.coffee @@ -22,11 +22,9 @@ Captcha.cache = haveCookie: -> /\b_ct=/.test(d.cookie) and QR.posts[0].thread isnt 'new' - getOne: (isReply) -> + getOne: -> @clear() - i = @captchas.findIndex((x) -> isReply or !x.challenge?) - if i >= 0 - captcha = @captchas.splice(i, 1)[0] + if (captcha = @captchas.shift()) @count() captcha else