refetch inbox when marking a message as read (#2131)

This commit is contained in:
biosfood 2023-09-13 15:27:50 +02:00 committed by GitHub
parent d7a80a184f
commit a97e608f27
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -918,12 +918,20 @@ export class Inbox extends Component<any, InboxState> {
async handleCommentReplyRead(form: MarkCommentReplyAsRead) {
const res = await HttpService.client.markCommentReplyAsRead(form);
if (this.state.unreadOrAll === UnreadOrAll.All) {
this.findAndUpdateCommentReply(res);
} else {
await this.refetch();
}
}
async handlePersonMentionRead(form: MarkPersonMentionAsRead) {
const res = await HttpService.client.markPersonMentionAsRead(form);
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);
if (this.state.unreadOrAll === UnreadOrAll.All) {
this.findAndUpdateMessage(res);
} else {
await this.refetch();
}
}
async handleMessageReport(form: CreatePrivateMessageReport) {