2 Commits

Author SHA1 Message Date
Balazs Toldi
ae125feae0 Adjust markPostAsRead to Lemmy 0.19.4 2024-06-23 14:32:18 +02:00
Balazs Toldi
03c1792262 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.
2024-06-23 14:18:17 +02:00
2 changed files with 3 additions and 1 deletions

View File

@@ -3,11 +3,13 @@ package eu.toldi.infinityforlemmy.dto;
public class ReadPostDTO {
private int post_id;
private int[] post_ids;
private boolean read;
private String auth;
public ReadPostDTO(int post_id, boolean read, String auth) {
this.post_id = post_id;
this.post_ids = new int[]{post_id};
this.read = read;
this.auth = auth;
}

View File

@@ -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,