From e32002fac8aad3b88b509dd6c5c444d2cc20f35a Mon Sep 17 00:00:00 2001 From: Austin Huang Date: Wed, 4 Nov 2020 13:18:20 -0500 Subject: [PATCH] fix fetching duplication --- .../customviews/helpers/PostFetcher.java | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/app/src/main/java/awais/instagrabber/customviews/helpers/PostFetcher.java b/app/src/main/java/awais/instagrabber/customviews/helpers/PostFetcher.java index 35a840e6..22145bfa 100644 --- a/app/src/main/java/awais/instagrabber/customviews/helpers/PostFetcher.java +++ b/app/src/main/java/awais/instagrabber/customviews/helpers/PostFetcher.java @@ -17,11 +17,13 @@ public class PostFetcher { } public void fetch() { - fetching = true; - postFetchService.fetch(result -> { - fetching = false; - fetchListener.onResult(result); - }); + if (!fetching) { + fetching = true; + postFetchService.fetch(result -> { + fetching = false; + fetchListener.onResult(result); + }); + } } public void reset() {