summaryrefslogtreecommitdiff
path: root/Juick
diff options
context:
space:
mode:
authorGravatar Vitaly Takmazov2021-06-08 00:56:07 +0300
committerGravatar Vitaly Takmazov2021-06-08 00:56:07 +0300
commitc3f57abfbd9bf9b97a3a230c7303a27a3c0b691f (patch)
tree2b4d4afa3a26322d52e3d0171762f91bd3bd9766 /Juick
parentb0fc6a10a0f30a648c98b143ef5e0479515c7e46 (diff)
Refresh user status on app activation
Diffstat (limited to 'Juick')
-rw-r--r--Juick/ViewControllers/JuickNavigationController.m10
1 files changed, 10 insertions, 0 deletions
diff --git a/Juick/ViewControllers/JuickNavigationController.m b/Juick/ViewControllers/JuickNavigationController.m
index d79206c..66ad042 100644
--- a/Juick/ViewControllers/JuickNavigationController.m
+++ b/Juick/ViewControllers/JuickNavigationController.m
@@ -19,6 +19,8 @@
@property(nonatomic, strong) UIButton *avatarButton;
+-(void) applicationActivated;
+
@end
@implementation JuickNavigationController
@@ -52,6 +54,7 @@
[super viewDidLoad];
[self refreshStatus];
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(userDidSignedIn:) name:UserChangedNotificationName object:nil];
+ [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(applicationActivated) name:UIApplicationDidBecomeActiveNotification object:nil];
}
- (void)userDidSignedIn:(NSNotification *) notification {
@@ -104,4 +107,11 @@
- (IBAction)showLoginForm:(id)sender {
[self performSegueWithIdentifier:@"loginSegue" sender:self];
}
+- (void)applicationActivated {
+ [self refreshStatus];
+}
+- (void)dealloc
+{
+ [[NSNotificationCenter defaultCenter] removeObserver:self name:UIApplicationDidBecomeActiveNotification object:nil];
+}
@end