Skip to content

Commit

Permalink
Partially reverse commit 07975ea
Browse files Browse the repository at this point in the history
Just keep the call to startProgressIndicator instead of directly animating spinner
Issue #670
  • Loading branch information
barijaona committed Jun 7, 2016
1 parent 2152974 commit 2e84a73
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
2 changes: 1 addition & 1 deletion src/AppController.h
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@
NSMutableDictionary * scriptPathMappings;
NSMenu * appDockMenu;
NSStatusItem * appStatusItem;
BOOL isProgressAnimatorActive;
NSInteger progressCount;
NSDictionary * standardURLs;
NSTimer * checkTimer;
NSInteger lastCountOfUnread;
Expand Down
12 changes: 5 additions & 7 deletions src/AppController.m
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ -(instancetype)init
if ((self = [super init]) != nil)
{
scriptPathMappings = [[NSMutableDictionary alloc] init];
isProgressAnimatorActive = NO;
progressCount = 0;
persistedStatusText = nil;
lastCountOfUnread = 0;
appStatusItem = nil;
Expand Down Expand Up @@ -3900,22 +3900,20 @@ -(void)sendBlogEvent:(NSString *)externalEditorBundleIdentifier title:(NSString
*/
-(void)startProgressIndicator
{
if (!isProgressAnimatorActive) {
if (progressCount++ == 0)
[spinner startAnimation:self];
isProgressAnimatorActive = YES;
}
}

/* stopProgressIndicator
* Stops the progress indicator on the info bar running
*/
-(void)stopProgressIndicator
{
NSAssert(isProgressAnimatorActive, @"Called stopProgressIndicator without a matching startProgressIndicator");
if (isProgressAnimatorActive)
NSAssert(progressCount > 0, @"Called stopProgressIndicator without a matching startProgressIndicator");
if (--progressCount < 1)
{
[spinner stopAnimation:self];
isProgressAnimatorActive = NO;
progressCount = 0;
}
}

Expand Down

0 comments on commit 2e84a73

Please sign in to comment.