1
0
mirror of https://gitlab.com/comunic/comunicmobile synced 2025-06-19 08:15:16 +00:00

Register to comment udpate events

This commit is contained in:
2020-04-18 16:46:55 +02:00
parent a60c1ed68c
commit 6b08b62832
4 changed files with 33 additions and 5 deletions

View File

@ -31,6 +31,13 @@ class NewCommentEvent {
NewCommentEvent(this.comment);
}
/// Updated comment
class UpdatedCommentEvent {
final Comment comment;
UpdatedCommentEvent(this.comment);
}
class EventsHelper {
static EventBus _mgr = EventBus();

View File

@ -126,6 +126,12 @@ class WebSocketHelper {
NewCommentEvent(CommentsHelper.apiToComment(msg.data)));
break;
// Updated comment
case "comment_updated":
EventsHelper.emit(
UpdatedCommentEvent(CommentsHelper.apiToComment(msg.data)));
break;
default:
throw Exception("Unknown message type: ${msg.title}");
}