Skip to content

Commit

Permalink
Fix bug in recently added try catch
Browse files Browse the repository at this point in the history
- Promise wasn't being awaited, thus `catch` clause would never be reached
  • Loading branch information
poltak committed Jun 9, 2024
1 parent 2fc8f8a commit 639c5f6
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions src/personal-cloud/background/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -330,12 +330,15 @@ export class PersonalCloudBackground {
async sendCountPendingDownloadsDownUpdate() {
if (this.emitEvents) {
try {
this.options.remoteEventEmitter.emit('cloudStatsUpdated', {
stats: {
pendingDownloads: this.stats.pendingDownloads - 1,
pendingUploads: this.stats.pendingUploads,
await this.options.remoteEventEmitter.emit(
'cloudStatsUpdated',
{
stats: {
pendingDownloads: this.stats.pendingDownloads - 1,
pendingUploads: this.stats.pendingUploads,
},
},
})
)
} catch (err) {
console.error('Error while emitting updated stats:', err)
}
Expand Down

0 comments on commit 639c5f6

Please sign in to comment.