From 03c17922626cb9bd9e4486c89622df93bff35b77 Mon Sep 17 00:00:00 2001 From: Balazs Toldi Date: Sun, 23 Jun 2024 14:18:17 +0200 Subject: [PATCH] Don't hide read posts on saved page This commit fixes the issue where if the option to hide read posts from the feed is activated, no posts show up in the saved section. Fixes #219. --- .../main/java/eu/toldi/infinityforlemmy/post/PostViewModel.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/main/java/eu/toldi/infinityforlemmy/post/PostViewModel.java b/app/src/main/java/eu/toldi/infinityforlemmy/post/PostViewModel.java index 4d341e77..f01bc43b 100644 --- a/app/src/main/java/eu/toldi/infinityforlemmy/post/PostViewModel.java +++ b/app/src/main/java/eu/toldi/infinityforlemmy/post/PostViewModel.java @@ -180,7 +180,7 @@ public class PostViewModel extends ViewModel { post -> !post.isRead() || !currentlyReadPostIdsLiveData.getValue()))), ViewModelKt.getViewModelScope(this)); currentlyReadPostIdsLiveData.setValue(postHistorySharedPreferences != null - && postHistorySharedPreferences.getBoolean((accountName == null ? "" : accountName) + SharedPreferencesUtils.HIDE_READ_POSTS_AUTOMATICALLY_BASE, false)); + && postHistorySharedPreferences.getBoolean((accountName == null ? "" : accountName) + SharedPreferencesUtils.HIDE_READ_POSTS_AUTOMATICALLY_BASE, false) && !userWhere.equals(PostPagingSource.USER_WHERE_SAVED)); } public PostViewModel(Executor executor, RetrofitHolder retrofit, String accessToken, String accountName,