Skip to content

Commit 3e78bcc

Browse files
author
Joey Lorich
committed
Add confirmation message on feed add
1 parent 94ed168 commit 3e78bcc

1 file changed

Lines changed: 10 additions & 2 deletions

File tree

EasyReader/Application/Controllers/Menu/EZRMenuTableViewDelegate.m

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@
2020

2121
#import "SVProgressHUD.h"
2222

23+
#import "TSMessage.h"
24+
2325
@interface EZRMenuTableViewDelegate ()
2426

2527
/// The menu search controller
@@ -42,11 +44,12 @@ - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath
4244
Feed *existingFeed = [Feed MR_findFirstByAttribute:@"id" withValue:feedData[@"id"]];
4345

4446
if (!existingFeed) {
47+
UIViewController *rootVC = [[[UIApplication sharedApplication].delegate window] rootViewController];
4548

4649
[Feed createFeedWithUrl:feedData[@"url"] success:^(id responseObject, NSInteger httpStatus) {
47-
50+
[TSMessage showNotificationInViewController:rootVC title:@"Easy Reader" subtitle:@"The selected feed has been added to the menu. Please allow a few minutes for new items to populate." type:TSMessageNotificationTypeSuccess];
4851
} failure:^(id responseObject, NSInteger httpStatus, NSError *error) {
49-
52+
[TSMessage showNotificationInViewController:rootVC title:@"Easy Reader" subtitle:@"There was an error adding that feed. Please try again later." type:TSMessageNotificationTypeError];
5053
}];
5154
}
5255
else if (![[User current].feeds containsObject:existingFeed])
@@ -66,6 +69,11 @@ - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath
6669
[((MFSideMenuContainerViewController *)tableView.window.rootViewController) setMenuState:MFSideMenuStateClosed];
6770
}
6871

72+
/**
73+
* Sends out a kEZRFeedSelected notification
74+
*
75+
* @param feed The feed to notify the selection of
76+
*/
6977
- (void)postSelectedNotificationForFeed:(Feed *)feed
7078
{
7179
NSNotificationCenter *defaultCenter = [NSNotificationCenter defaultCenter];

0 commit comments

Comments
 (0)