Skip to content

Commit

Permalink
#17: fixes local indicator counting on reminder creation
Browse files Browse the repository at this point in the history
  • Loading branch information
Dirk Peter committed May 29, 2024
1 parent cf48c71 commit cc2cb82
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
4 changes: 2 additions & 2 deletions plugin/components/reminder-modal/reminder-modal.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,8 @@ export class ReminderModalComponent implements OnInit {

ngOnInit(): void {
this.asset = this.getAssetFromRoute(this.activatedRoute.snapshot);
this.reminder.source.id = this.asset.id;
this.reminder.source.name = String(this.asset.name) || '';
// this.reminder.source.id = this.asset.id;
// this.reminder.source.name = String(this.asset.name) || '';
}

close() {
Expand Down
3 changes: 2 additions & 1 deletion plugin/services/reminder.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,7 @@ export class ReminderService {

private handleReminderUpdate(message: Partial<RealtimeMessage<Reminder>>): Reminder {
let reminders = cloneDeep(this.reminders);
let now = moment();

if (message.realtimeAction === 'DELETE') return this.deleteRminderFromList(message, reminders);

Expand All @@ -208,7 +209,7 @@ export class ReminderService {
break;
case 'CREATE':
reminders = [...reminders, reminder];
if (reminder.status === ReminderStatus.active) this.reminderCounter++;
if (reminder.status === ReminderStatus.active && moment(reminder.time) <= now) this.reminderCounter++;
break;
}

Expand Down

0 comments on commit cc2cb82

Please sign in to comment.