Skip to content

Commit

Permalink
[Store category sorting for recent, favorites and uncategorized per a…
Browse files Browse the repository at this point in the history
…ccount](nextcloud#1169)
  • Loading branch information
AlpAcA0072 committed May 16, 2021
1 parent 869f783 commit ac6e07c
Showing 1 changed file with 11 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -177,10 +177,19 @@ public List<Account> getAccounts() {

@WorkerThread
public void deleteAccount(@NonNull Account account) {
// final Context ctx = context.getApplicationContext();
// final SharedPreferences sp = PreferenceManager.getDefaultSharedPreferences(ctx);
try {
ApiProvider.invalidateAPICache(AccountImporter.getSingleSignOnAccount(context, account.getAccountName()));
executor.submit(() -> {
final Context ctx = context.getApplicationContext();
final SharedPreferences.Editor sp = PreferenceManager.getDefaultSharedPreferences(ctx).edit();
final String keyRecentCategory = ENavigationCategoryType.RECENT.toString().concat(String.valueOf(account.getId()));
final String keyUncategorizedCategory = ENavigationCategoryType.UNCATEGORIZED.toString().concat(String.valueOf(account.getId()));
final String keyFavoritesCategory = ENavigationCategoryType.FAVORITES.toString().concat(String.valueOf(account.getId()));
sp.remove(keyRecentCategory);
sp.remove(keyUncategorizedCategory);
sp.remove(keyFavoritesCategory);
sp.apply();
});
} catch (NextcloudFilesAppAccountNotFoundException e) {
e.printStackTrace();
ApiProvider.invalidateAPICache();
Expand Down

0 comments on commit ac6e07c

Please sign in to comment.