Skip to content

Commit

Permalink
Enable AutoEnableChainsTokens script
Browse files Browse the repository at this point in the history
  • Loading branch information
Quangdm-cdm committed Jan 22, 2025
1 parent 0ba6a4e commit cffbfc3
Showing 1 changed file with 21 additions and 22 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -165,27 +165,26 @@ export class InappNotificationService implements CronServiceInterface {
}

async validateAndWriteNotificationsToDB (notifications: _BaseNotificationInfo[], address: string) {
return;
// const proxyId = this.keyringService.context.belongUnifiedAccount(address) || address;
// const accountName = this.keyringService.context.getCurrentAccountProxyName(proxyId);
// const passNotifications: _NotificationInfo[] = [];
// const [comparedNotifications, remindTimeConfig] = await Promise.all([
// this.fetchNotificationsByParams({ notificationTab: NotificationTab.ALL, proxyId }),
// await fetchLastestRemindNotificationTime()
// ]);
//
// for (const candidateNotification of notifications) {
// candidateNotification.title = candidateNotification.title.replace('{{accountName}}', accountName);
//
// if (this.passValidateNotification(candidateNotification, comparedNotifications, remindTimeConfig)) {
// passNotifications.push({
// ...candidateNotification,
// proxyId
// });
// }
// }
//
// await this.dbService.upsertNotifications(passNotifications);
const proxyId = this.keyringService.context.belongUnifiedAccount(address) || address;
const accountName = this.keyringService.context.getCurrentAccountProxyName(proxyId);
const passNotifications: _NotificationInfo[] = [];
const [comparedNotifications, remindTimeConfig] = await Promise.all([
this.fetchNotificationsByParams({ notificationTab: NotificationTab.ALL, proxyId }),
await fetchLastestRemindNotificationTime()
]);

for (const candidateNotification of notifications) {
candidateNotification.title = candidateNotification.title.replace('{{accountName}}', accountName);

if (this.passValidateNotification(candidateNotification, comparedNotifications, remindTimeConfig)) {
passNotifications.push({
...candidateNotification,
proxyId
});
}
}

await this.dbService.upsertNotifications(passNotifications);
}

cronCreateBridgeClaimNotification () {
Expand Down Expand Up @@ -374,7 +373,7 @@ export class InappNotificationService implements CronServiceInterface {

try {
this.status = ServiceStatus.STARTING;
// await this.startCron();
await this.startCron();
this.status = ServiceStatus.STARTED;
} catch (e) {

Expand Down

1 comment on commit cffbfc3

@saltict
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.