@@ -21,10 +21,12 @@ class PostActionMenuController: Votable {
21
21
public var parent : InterfaceController ?
22
22
@IBOutlet var thumbImage : WKInterfaceImage !
23
23
@IBOutlet var thumbGroup : WKInterfaceGroup !
24
+ @IBOutlet var readlater : WKInterfaceButton !
24
25
@IBOutlet var upvoteButton : WKInterfaceButton !
25
26
@IBOutlet var downvoteButton : WKInterfaceButton !
26
27
@IBOutlet var linkInfo : WKInterfaceLabel !
27
28
var id : String ?
29
+ var sub : String ?
28
30
@IBAction func didUpvote( ) {
29
31
( WKExtension . shared ( ) . visibleInterfaceController as? Votable ) ? . sharedUp = upvoteButton
30
32
( WKExtension . shared ( ) . visibleInterfaceController as? Votable ) ? . sharedDown = downvoteButton
@@ -36,6 +38,11 @@ class PostActionMenuController: Votable {
36
38
( WKExtension . shared ( ) . visibleInterfaceController as? Votable ) ? . doVote ( id: id!, upvote: false , downvote: true )
37
39
}
38
40
41
+ @IBAction func didSaveLater( ) {
42
+ ( WKExtension . shared ( ) . visibleInterfaceController as? Votable ) ? . sharedReadLater = readlater
43
+ ( WKExtension . shared ( ) . visibleInterfaceController as? Votable ) ? . doReadLater ( id: id!, sub: sub!)
44
+ }
45
+
39
46
@IBAction func openComments( ) {
40
47
// if !(self.parent?.isPro ?? true) {
41
48
// self.parent?.presentController(withName: "Pro", context: parent!)
@@ -89,9 +96,11 @@ class PostActionMenuController: Votable {
89
96
90
97
upvoteButton. setBackgroundColor ( ( myModel. dictionary [ " upvoted " ] ?? false ) as! Bool ? UIColor . init ( hexString: " #FF5700 " ) : UIColor . gray)
91
98
downvoteButton. setBackgroundColor ( ( myModel. dictionary [ " downvoted " ] ?? false ) as! Bool ? UIColor . init ( hexString: " #9494FF " ) : UIColor . gray)
99
+ readlater. setBackgroundColor ( ( myModel. dictionary [ " readLater " ] ?? false ) as! Bool ? UIColor . init ( hexString: " #4CAF50 " ) : UIColor . gray)
92
100
93
101
scoreLabel. setText ( myModel. scoreText)
94
102
id = myModel. id
103
+ sub = myModel. sub
95
104
commentLabel. setText ( myModel. commentText)
96
105
WCSession . default. sendMessage ( [ " comments " : myModel. id!] , replyHandler: { ( message) in
97
106
self . comments = message [ " comments " ] as? [ NSDictionary ] ?? [ ]
0 commit comments