Skip to content
This repository has been archived by the owner on Oct 28, 2024. It is now read-only.

Commit

Permalink
fix mark all read button
Browse files Browse the repository at this point in the history
  • Loading branch information
sk22 committed Jun 27, 2023
1 parent c101813 commit 5754c62
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -132,8 +132,8 @@ private void markAsRead(){
}
}

private void updateMarkAllReadButton(){
markAllReadItem.setEnabled(!allNotificationsFragment.getData().isEmpty() &&
public void updateMarkAllReadButton(){
markAllReadItem.setVisible(!allNotificationsFragment.getData().isEmpty() &&
!realUnreadMarker.equals(allNotificationsFragment.getData().get(0).id));
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,9 @@ public void onSuccess(PaginatedResponse<List<Notification>> result){
onDataLoaded(result.items.stream().filter(n->n.type!=null).collect(Collectors.toList()), !result.items.isEmpty());
maxID=result.maxID;
reloadingFromCache=false;
if (getParentFragment() instanceof NotificationsFragment nf) {
nf.updateMarkAllReadButton();
}
}
});
}
Expand Down Expand Up @@ -300,6 +303,7 @@ public void onRefresh(){
if (getParentFragment() instanceof NotificationsFragment nf) {
AccountSessionManager.get(accountID).reloadNotificationsMarker(m->{
nf.unreadMarker=nf.realUnreadMarker=m;
nf.updateMarkAllReadButton();
});
}
}
Expand Down

0 comments on commit 5754c62

Please sign in to comment.