Skip to content

Commit 206f6af

Browse files
dotansimhadarkbasic
authored andcommitted
Step 10.2: Add counter to client side
1 parent 3057e70 commit 206f6af

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/pages/messages/messages.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ export class MessagesPage implements OnInit, OnDestroy {
2323
senderId: string;
2424
loadingMessages: boolean;
2525
messagesComputation: Subscription;
26+
messagesBatchCounter: number = 0;
2627

2728
constructor(
2829
navParams: NavParams,
@@ -65,7 +66,8 @@ export class MessagesPage implements OnInit, OnDestroy {
6566
this.scrollOffset = this.scroller.scrollHeight;
6667

6768
MeteorObservable.subscribe('messages',
68-
this.selectedChat._id
69+
this.selectedChat._id,
70+
++this.messagesBatchCounter
6971
).subscribe(() => {
7072
// Keep tracking changes in the dataset and re-render the view
7173
if (!this.messagesComputation) {

0 commit comments

Comments
 (0)