#79 Show posts from official Fedora facebook page and Twitter handle
Merged a year ago by a2batic. Opened a year ago by amitosh.
amitosh/Fedora-app social-links  into  master

file modified
+12 -8

@@ -5,14 +5,14 @@ 

  import { FacebookProvider } from '../../providers/social/facebook';

  import { TwitterProvider } from '../../providers/social/twitter';

  import { SocialMediaPost } from '../../providers/social/social';

- import { forkJoin } from 'rxjs/observable/forkJoin';

+ import { combineLatest } from 'rxjs/observable/combineLatest';

  import { FedoraMagazineService, Post, Image } from '../../providers/fedora-magazine/fedora-magazine';

  import { CommunityBlogService } from '../../providers/community-blog/community-blog';

  

- const HANDLE = {

-   FB: 'fedoraqa',

-   TWITTER: 'fedora_qa',

- };

+ const HANDLE = Object.seal({

+   FB: 'TheFedoraProject',

+   TWITTER: 'fedora',

+ });

  

  @Component({

    selector: 'page-home',

@@ -41,7 +41,11 @@ 

     */

    private blogposts: Post[];

  

-   constructor(public navCtrl: NavController, private browser: Browser, private fb: FacebookProvider, private twitter: TwitterProvider, private fedoraMag: FedoraMagazineService, private communityblog: CommunityBlogService) {

+   constructor(public navCtrl: NavController, private browser: Browser,

+               private fb: FacebookProvider,

+               private twitter: TwitterProvider,

+               private fedoraMag: FedoraMagazineService,

+               private communityblog: CommunityBlogService) {

      this.socialposts = [];

      this.blogposts = [];

      this.carousel = [];

@@ -53,7 +57,7 @@ 

     * Currently, we fetch posts from Facebook and Twitter

     */

    private updateSocialMedia(): void {

-     forkJoin(this.fb.getPosts(HANDLE.FB), this.twitter.getPosts(HANDLE.TWITTER))

+     combineLatest(this.fb.getPosts(HANDLE.FB), this.twitter.getPosts(HANDLE.TWITTER))

        .subscribe(values => {

          this.socialposts = [...values[0], ...values[1]] as SocialMediaPost[];

        });

@@ -103,4 +107,4 @@ 

      this.navCtrl.push(NotificationsPage, { animate: true, direction: 'forward' });

    }

  

- } 

\ No newline at end of file

+ }

@@ -35,8 +35,8 @@ 

    content: string,

  

    /**

-  * Date of the post

-  */

+    * Date of the post

+    */

    date: string,

  }

  

@@ -65,5 +65,5 @@ 

     * @param args Extra args for pagination etc.

     * @returns Observable which emits an array of posts

     */

-   fetchPosts(resID: string, args?:{ offset?: string }): Observable<SocialMediaPost[]>

+   fetchPosts(resID: string, args?: { offset?: string }): Observable<SocialMediaPost[]>

  }

rebased onto 1016541

a year ago

Pull-Request has been merged by a2batic

a year ago