Skip to content

Commit

Permalink
Step 21.28: Look for the thumbnails
Browse files Browse the repository at this point in the history
  • Loading branch information
dotansimha authored and DAB0mB committed Dec 14, 2016
1 parent d891420 commit 97b1898
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions client/imports/app/parties/parties-upload.component.ts
Expand Up @@ -3,8 +3,10 @@ import {Component, OnInit} from '@angular/core';
import template from './parties-upload.component.html';

import { upload } from '../../../../both/methods/images.methods';
import {Subject, Subscription} from "rxjs";
import {Subject, Subscription, Observable} from "rxjs";
import {MeteorObservable} from "meteor-rxjs";
import {Thumb} from "../../../../both/models/image.model";
import {Thumbs} from "../../../../both/collections/images.collection";

@Component({
selector: 'parties-upload',
Expand All @@ -15,6 +17,7 @@ export class PartiesUploadComponent implements OnInit {
uploading: boolean = false;
files: Subject<string[]> = new Subject<string[]>();
thumbsSubscription: Subscription;
thumbs: Observable<Thumb[]>;

constructor() {}

Expand All @@ -26,7 +29,14 @@ export class PartiesUploadComponent implements OnInit {
this.thumbsSubscription = undefined;
}

this.thumbsSubscription = MeteorObservable.subscribe("thumbs", filesArray).subscribe();
this.thumbsSubscription = MeteorObservable.subscribe("thumbs", filesArray).subscribe(() => {
this.thumbs = Thumbs.find({
originalStore: 'images',
originalId: {
$in: filesArray
}
}).zone();
});
});
});
}
Expand Down

0 comments on commit 97b1898

Please sign in to comment.