File tree Expand file tree Collapse file tree 1 file changed +3
-4
lines changed
Expand file tree Collapse file tree 1 file changed +3
-4
lines changed Original file line number Diff line number Diff line change @@ -18,6 +18,7 @@ export class MessagesPage implements OnInit, OnDestroy {
1818 message : string = '' ;
1919 autoScroller : MutationObserver ;
2020 scrollOffset = 0 ;
21+ senderId : string ;
2122
2223 constructor (
2324 navParams : NavParams ,
@@ -26,6 +27,7 @@ export class MessagesPage implements OnInit, OnDestroy {
2627 this . selectedChat = < Chat > navParams . get ( 'chat' ) ;
2728 this . title = this . selectedChat . title ;
2829 this . picture = this . selectedChat . picture ;
30+ this . senderId = Meteor . userId ( ) ;
2931 }
3032
3133 private get messagesPageContent ( ) : Element {
@@ -55,8 +57,6 @@ export class MessagesPage implements OnInit, OnDestroy {
5557 }
5658
5759 findMessagesDayGroups ( ) {
58- let isEven = false ;
59-
6060 return Messages . find ( {
6161 chatId : this . selectedChat . _id
6262 } , {
@@ -67,8 +67,7 @@ export class MessagesPage implements OnInit, OnDestroy {
6767
6868 // Compose missing data that we would like to show in the view
6969 messages . forEach ( ( message ) => {
70- message . ownership = isEven ? 'mine' : 'other' ;
71- isEven = ! isEven ;
70+ message . ownership = this . senderId == message . senderId ? 'mine' : 'other' ;
7271
7372 return message ;
7473 } ) ;
You can’t perform that action at this time.
0 commit comments