fix fetching duplication

This commit is contained in:
Austin Huang 2020-11-04 13:18:20 -05:00
parent bf9dcacd40
commit e32002fac8
No known key found for this signature in database
GPG Key ID: 84C23AA04587A91F
1 changed files with 7 additions and 5 deletions

View File

@ -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() {