Skip to content

Commit

Permalink
keep extension icon status correct
Browse files Browse the repository at this point in the history
  • Loading branch information
alanhamlett committed Aug 27, 2024
1 parent d34c8ca commit d66b1b5
Showing 1 changed file with 7 additions and 9 deletions.
16 changes: 7 additions & 9 deletions src/core/WakaTimeCore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -93,21 +93,19 @@ class WakaTimeCore {
return;
}

if (!this.shouldSendHeartbeat(heartbeat)) return;

if (!this.canSendHeartbeat(url, settings)) {
await changeExtensionStatus('ignored');
return;
}

if (this.db) {
// append heartbeat to queue
await this.db.add('cacheHeartbeats', heartbeat);

if (settings.extensionStatus !== 'notSignedIn') {
await changeExtensionStatus('allGood');
}
if (settings.extensionStatus !== 'notSignedIn') {
await changeExtensionStatus('allGood');
}

if (!this.shouldSendHeartbeat(heartbeat)) return;

// append heartbeat to queue
await this.db?.add('cacheHeartbeats', heartbeat);
}

/**
Expand Down

0 comments on commit d66b1b5

Please sign in to comment.