From 85ed895c5f56e2468b1c4973faa99a64da36a6ad Mon Sep 17 00:00:00 2001 From: Dessalines Date: Mon, 29 Apr 2019 09:51:13 -0700 Subject: Adding mark all as read - Fixes #107 --- ui/src/components/inbox.tsx | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) (limited to 'ui/src/components/inbox.tsx') diff --git a/ui/src/components/inbox.tsx b/ui/src/components/inbox.tsx index 02d813f3..f4ef2ecd 100644 --- a/ui/src/components/inbox.tsx +++ b/ui/src/components/inbox.tsx @@ -58,7 +58,16 @@ export class Inbox extends Component {
-
Inbox for {user.username}
+
+ Inbox for {user.username} +
+ {this.state.replies.length > 0 && this.state.unreadType == UnreadType.Unread && +
    +
  • + mark all as read +
  • +
+ } {this.selects()} {this.replies()} {this.paginator()} @@ -147,13 +156,17 @@ export class Inbox extends Component { i.refetch(); } + markAllAsRead() { + WebSocketService.Instance.markAllAsRead(); + } + parseMessage(msg: any) { console.log(msg); let op: UserOperation = msgOp(msg); if (msg.error) { alert(msg.error); return; - } else if (op == UserOperation.GetReplies) { + } else if (op == UserOperation.GetReplies || op == UserOperation.MarkAllAsRead) { let res: GetRepliesResponse = msg; this.state.replies = res.replies; this.sendRepliesCount(); -- cgit v1.2.3