From a3a4ec6e39331b35a3272b67d2c2a93e19c61834 Mon Sep 17 00:00:00 2001 From: Lavie <5081484+lgariv@users.noreply.github.com> Date: Sun, 14 Mar 2021 02:03:47 +0200 Subject: [PATCH] Fixed Welcome screen showing up after every respring --- welcome.x | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/welcome.x b/welcome.x index cc8c3ce..cde5ccf 100644 --- a/welcome.x +++ b/welcome.x @@ -56,11 +56,9 @@ dispatch_once(&progOnceToken, ^{ NSString *valueForMyKey; @try { - valueForMyKey = [[NSUserDefaults standardUserDefaults] stringForKey:@"progFirstTime"]; + valueForMyKey = [[NSUserDefaults standardUserDefaults] objectForKey:@"progFirstTime"]; NSLog(@"[Prog] valueForMyKey:%@", valueForMyKey); - // if ([valueForMyKey isEqualToString:@"NO"]) { - [[NSUserDefaults standardUserDefaults] setObject:@"YES" forKey:@"progFirstTime"]; - // } + // [[NSUserDefaults standardUserDefaults] setObject:@"YES" forKey:@"progFirstTime"]; } @catch ( NSException *exception ) { if (exception) { @@ -68,7 +66,7 @@ } valueForMyKey = @"YES"; } - if ([valueForMyKey isEqualToString:@"YES"]) { + if ([valueForMyKey isEqualToString:@"YES"] || [[NSUserDefaults standardUserDefaults] objectForKey:@"progFirstTime"] == nil) { [[NSUserDefaults standardUserDefaults] setObject:@"NO" forKey:@"progFirstTime"]; UIViewController *donateController = [[UIViewController alloc] init]; [[donateController view] setBackgroundColor:[UIColor systemBackgroundColor]];