mirror of
				https://gitlab.com/comunic/comunicmobile
				synced 2025-11-04 04:04:18 +00:00 
			
		
		
		
	Register to comment udpate events
This commit is contained in:
		@@ -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();
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -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}");
 | 
			
		||||
    }
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user