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 DAB0mB committed Feb 13, 2017
1 parent 7950862 commit c2d1815
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/pages/messages/messages.ts
Original file line number Diff line number Diff line change
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 c2d1815

Please sign in to comment.