Skip to content

Commit da82c01

Browse files
committed
Restart timer animation when returning from background
// FREEBIE
1 parent 04f5c3c commit da82c01

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

Signal/src/view controllers/MessagesViewController.m

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -305,6 +305,10 @@ - (void)toggleObservers:(BOOL)shouldObserve
305305
selector:@selector(startReadTimer)
306306
name:UIApplicationWillEnterForegroundNotification
307307
object:nil];
308+
[[NSNotificationCenter defaultCenter] addObserver:self
309+
selector:@selector(startExpirationTimerAnimations)
310+
name:UIApplicationWillEnterForegroundNotification
311+
object:nil];
308312
[[NSNotificationCenter defaultCenter] addObserver:self
309313
selector:@selector(cancelReadTimer)
310314
name:UIApplicationDidEnterBackgroundNotification
@@ -349,8 +353,7 @@ - (void)viewWillAppear:(BOOL)animated
349353
[self.thread touch];
350354

351355
// restart any animations that were stopped e.g. while inspecting the contact info screens.
352-
[[NSNotificationCenter defaultCenter] postNotificationName:OWSMessagesViewControllerDidAppearNotification
353-
object:nil];
356+
[self startExpirationTimerAnimations];
354357

355358
OWSDisappearingMessagesConfiguration *configuration =
356359
[OWSDisappearingMessagesConfiguration fetchObjectWithUniqueID:self.thread.uniqueId];
@@ -437,6 +440,12 @@ - (void)viewWillDisappear:(BOOL)animated {
437440
[self saveDraft];
438441
}
439442

443+
- (void)startExpirationTimerAnimations
444+
{
445+
[[NSNotificationCenter defaultCenter] postNotificationName:OWSMessagesViewControllerDidAppearNotification
446+
object:nil];
447+
}
448+
440449
- (void)viewDidDisappear:(BOOL)animated {
441450
[super viewDidDisappear:animated];
442451
self.inputToolbar.contentView.textView.editable = NO;

0 commit comments

Comments
 (0)