import { Component } from '@angular/core';
import { NavController, NavParams } from 'ionic-angular';
import { Storage } from '@ionic/storage';

import * as pnut from 'pnut-butter';

/**
 * Generated class for the ThreadPage page.
 *
 * See http://ionicframework.com/docs/components/#navigation for more info
 * on Ionic pages and navigation.
 */
@Component({
  selector: 'page-thread',
  templateUrl: 'thread.html',
})
export class ThreadPage {

  title: string;
  posts: Array<Object> = [];
  myUsername: string;
  hideImg: boolean = false;
  ccOnReply: boolean = false;

  constructor(public navCtrl: NavController, public navParams: NavParams,
    private storage: Storage) {
    this.posts = this.navParams.data.posts;
    this.myUsername = this.navParams.data.me;

    this.storage.get('hideimg').then((val) => {
      this.hideImg = val;
    });

    this.storage.get('cc').then((val) => {
      this.ccOnReply = val;
    });

  }

}
