Skip to content

Commit

Permalink
Step 10.2: Add counter to client side
Browse files Browse the repository at this point in the history
  • Loading branch information
dotansimha authored and darkbasic committed Oct 16, 2017
1 parent 3057e70 commit 206f6af
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/pages/messages/messages.ts
Expand Up @@ -23,6 +23,7 @@ export class MessagesPage implements OnInit, OnDestroy {
senderId: string;
loadingMessages: boolean;
messagesComputation: Subscription;
messagesBatchCounter: number = 0;

constructor(
navParams: NavParams,
Expand Down Expand Up @@ -65,7 +66,8 @@ export class MessagesPage implements OnInit, OnDestroy {
this.scrollOffset = this.scroller.scrollHeight;

MeteorObservable.subscribe('messages',
this.selectedChat._id
this.selectedChat._id,
++this.messagesBatchCounter
).subscribe(() => {
// Keep tracking changes in the dataset and re-render the view
if (!this.messagesComputation) {
Expand Down

0 comments on commit 206f6af

Please sign in to comment.