Skip to content

Commit

Permalink
fix some issues with the thank you screen
Browse files Browse the repository at this point in the history
  • Loading branch information
krzd committed Sep 20, 2013
1 parent cd010a0 commit b9f73b0
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 14 deletions.
23 changes: 11 additions & 12 deletions ShnergleApp/ShareViewController.m
Expand Up @@ -203,14 +203,7 @@ - (void)redeem {
if (appDelegate.redeeming != nil) {
[Request post:@"promotion_redemptions/set" params:@{@"promotion_id": appDelegate.redeeming} delegate:self callback:@selector(redeemed:)];
} else {
int pointsAwarded = 0;
if (appDelegate.shnergleThis) pointsAwarded += 4;
if (self.twSwitch.on) pointsAwarded += 5;
if (self.fbSwitch.on) pointsAwarded += 5;
ThankYouViewController *vc = (ThankYouViewController *)[self.storyboard instantiateViewControllerWithIdentifier:@"thankyouverymuch"];
[vc setupFields:[NSString stringWithFormat:@"Congratulations, you earned %d points!",pointsAwarded] : @"" : @""];
[self.navigationController pushViewController:vc animated:YES];
//[self presentViewController:vc animated:YES completion:nil];
[self thankYou:@"" :@""];
}
}

Expand All @@ -235,11 +228,17 @@ - (void)redeemed:(NSString *)response {
passcode = response;
}

UIStoryboard *sb = [UIStoryboard storyboardWithName:@"MainStoryboard" bundle:nil];
[self thankYou:msg :passcode];
}

ThankYouViewController *vc = (ThankYouViewController *)[sb instantiateViewControllerWithIdentifier:@"thankyouverymuch"];
[vc setupFields:@"" :msg :passcode];
[self presentViewController:vc animated:YES completion:nil];
- (void)thankYou:(NSString *)msg :(NSString *)passcode {
int pointsAwarded = 0;
if (appDelegate.shnergleThis) pointsAwarded += 4;
if (self.twSwitch.on) pointsAwarded += 5;
if (self.fbSwitch.on) pointsAwarded += 5;
ThankYouViewController *vc = (ThankYouViewController *)[self.storyboard instantiateViewControllerWithIdentifier:@"thankyouverymuch"];
[vc setupFields:[NSString stringWithFormat:@"Congratulations, you earned %d points!",pointsAwarded] : msg :passcode];
[self.navigationController pushViewController:vc animated:YES];
}

- (IBAction)selectFriendsButtonAction:(id)sender {
Expand Down
4 changes: 2 additions & 2 deletions ShnergleApp/ThankYouViewController.m
Expand Up @@ -24,8 +24,8 @@ - (void)viewDidLoad {
- (void)setupFields:(NSString *)points :(NSString *)msg :(NSString *)passcode{
pointsString = points;
if ([msg length] > 0) {
passcodeInfoString = msg;
passcodeString = passcode;
passcodeString = msg;
passcodeInfoString = passcode;
} else {
shouldHidePasscode = YES;
}
Expand Down

0 comments on commit b9f73b0

Please sign in to comment.