From e8c1ba58712f46308d2f4b0ec6392d8611b143e8 Mon Sep 17 00:00:00 2001 From: oleh-mryhlod Date: Thu, 8 Oct 2020 13:19:55 +0300 Subject: [PATCH] Fix RNFetchBlobSession remove method --- class/RNFetchBlobSession.js | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/class/RNFetchBlobSession.js b/class/RNFetchBlobSession.js index f40875cb2..75315853f 100644 --- a/class/RNFetchBlobSession.js +++ b/class/RNFetchBlobSession.js @@ -44,12 +44,9 @@ export default class RNFetchBlobSession { } remove(path:string):RNFetchBlobSession { - let list = sessions[this.name] - for(let i of list) { - if(list[i] === path) { - sessions[this.name].splice(i, 1) - break; - } + let removeIndex = sessions[this.name].indexOf(path) + if (removeIndex !== -1) { + sessions[this.name].splice(removeIndex, 1) } return this }