Fix shared and fav section crash by avoiding multiple api calls.

This commit is contained in:
A117870935 2023-07-13 18:42:02 +05:30
parent 67adaa6fea
commit e290a0a240

View file

@ -6,9 +6,11 @@
* @author David A. Velasco
* @author Andy Scherzinger
* @author Chris Narkiewicz
* @author TSI-mc
* Copyright (C) 2011 Bartek Przybylski
* Copyright (C) 2016 ownCloud Inc.
* Copyright (C) 2018 Andy Scherzinger
* Copyright (C) 2023 TSI-mc
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2,
@ -1657,6 +1659,12 @@ public class OCFileListFragment extends ExtendedListFragment implements
return;
}
// avoid calling api multiple times if async task is already executing
if (remoteOperationAsyncTask != null && remoteOperationAsyncTask.getStatus() != AsyncTask.Status.FINISHED) {
Log_OC.d(TAG, "OCFileListSearchAsyncTask already running skipping new api call for search event: " + searchEvent.getSearchType());
return;
}
prepareCurrentSearch(event);
searchFragment = true;
setEmptyListLoadingMessage();