|
@@ -1,5 +1,7 @@
|
|
|
import { Component, Input, ChangeDetectorRef } from "@angular/core";
|
|
|
import { TwitterApiProvider } from "../../providers/twitter-api/twitter-api";
|
|
|
+import { NavController } from "ionic-angular";
|
|
|
+import { WriteTweetPage } from "../../pages/write-tweet/write-tweet";
|
|
|
|
|
|
/**
|
|
|
* Generated class for the TweetActionsComponent component.
|
|
@@ -17,10 +19,11 @@ export class TweetActionsComponent {
|
|
|
|
|
|
constructor(
|
|
|
private twitter: TwitterApiProvider,
|
|
|
- private ref: ChangeDetectorRef
|
|
|
+ private ref: ChangeDetectorRef,
|
|
|
+ private navCtrl: NavController
|
|
|
) {}
|
|
|
|
|
|
- like(id) {
|
|
|
+ like(id: string): void {
|
|
|
if (!this.data["private_tweet"]) {
|
|
|
this.twitter.likeTweet(id).then(() => {
|
|
|
this.data["favorited"] = true;
|
|
@@ -30,7 +33,7 @@ export class TweetActionsComponent {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- removeLike(id) {
|
|
|
+ removeLike(id: string): void {
|
|
|
if (!this.data["private_tweet"]) {
|
|
|
this.twitter.unlikeTweet(id).then(() => {
|
|
|
this.data["favorited"] = false;
|
|
@@ -39,4 +42,8 @@ export class TweetActionsComponent {
|
|
|
});
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+ retweetStatus(id: string): void {
|
|
|
+ this.navCtrl.push(WriteTweetPage, { tweetId: id });
|
|
|
+ }
|
|
|
}
|