mirror of
https://github.com/LemmyNet/lemmy-ui.git
synced 2024-11-01 01:59:56 +00:00
refetch inbox when marking a message as read (#2131)
This commit is contained in:
parent
d7a80a184f
commit
a97e608f27
1 changed files with 15 additions and 3 deletions
|
@ -918,12 +918,20 @@ export class Inbox extends Component<any, InboxState> {
|
|||
|
||||
async handleCommentReplyRead(form: MarkCommentReplyAsRead) {
|
||||
const res = await HttpService.client.markCommentReplyAsRead(form);
|
||||
this.findAndUpdateCommentReply(res);
|
||||
if (this.state.unreadOrAll === UnreadOrAll.All) {
|
||||
this.findAndUpdateCommentReply(res);
|
||||
} else {
|
||||
await this.refetch();
|
||||
}
|
||||
}
|
||||
|
||||
async handlePersonMentionRead(form: MarkPersonMentionAsRead) {
|
||||
const res = await HttpService.client.markPersonMentionAsRead(form);
|
||||
this.findAndUpdateMention(res);
|
||||
if (this.state.unreadOrAll === UnreadOrAll.All) {
|
||||
this.findAndUpdateMention(res);
|
||||
} else {
|
||||
await this.refetch();
|
||||
}
|
||||
}
|
||||
|
||||
async handleBanFromCommunity(form: BanFromCommunity) {
|
||||
|
@ -948,7 +956,11 @@ export class Inbox extends Component<any, InboxState> {
|
|||
|
||||
async handleMarkMessageAsRead(form: MarkPrivateMessageAsRead) {
|
||||
const res = await HttpService.client.markPrivateMessageAsRead(form);
|
||||
this.findAndUpdateMessage(res);
|
||||
if (this.state.unreadOrAll === UnreadOrAll.All) {
|
||||
this.findAndUpdateMessage(res);
|
||||
} else {
|
||||
await this.refetch();
|
||||
}
|
||||
}
|
||||
|
||||
async handleMessageReport(form: CreatePrivateMessageReport) {
|
||||
|
|
Loading…
Reference in a new issue