Skip to content

Commit

Permalink
UnreadCounterService: use async functions
Browse files Browse the repository at this point in the history
  • Loading branch information
biosfood committed Oct 24, 2023
1 parent 377beee commit 21f61de
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/shared/services/UnreadCounterService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ export class UnreadCounterService {
return true;
}

public updatePrivateMessages = async () => {
public async updatePrivateMessages() {
if (this.shouldUpdate) {
const unreadCountRes = await HttpService.client.getUnreadCount();
if (unreadCountRes.state === "success") {
Expand All @@ -58,9 +58,9 @@ export class UnreadCounterService {
);
}
}
};
}

public updateReports = async () => {
public async updateReports() {
if (this.shouldUpdate && UserService.Instance.moderatesSomething) {
const reportCountRes = await HttpService.client.getReportCount({});
if (reportCountRes.state === "success") {
Expand All @@ -75,9 +75,9 @@ export class UnreadCounterService {
);
}
}
};
}

public updateApplications = async () => {
public async updateApplications() {
if (this.shouldUpdate && amAdmin()) {
const unreadApplicationsRes =
await HttpService.client.getUnreadRegistrationApplicationCount();
Expand All @@ -87,7 +87,7 @@ export class UnreadCounterService {
);
}
}
};
}

public updateAll = async () => {
this.updatePrivateMessages();
Expand Down

0 comments on commit 21f61de

Please sign in to comment.