Skip to content

Commit

Permalink
fix: meeting countdown doesn't calculate until +1s
Browse files Browse the repository at this point in the history
  • Loading branch information
lwestfall committed Jan 4, 2024
1 parent 913c378 commit 58488e2
Showing 1 changed file with 8 additions and 4 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Component, Input, OnDestroy } from '@angular/core';
import { Component, Input, OnDestroy, OnInit } from '@angular/core';
import moment from 'moment';
import { MeetingDto } from '../../api/models';

Expand All @@ -7,12 +7,16 @@ import { MeetingDto } from '../../api/models';
templateUrl: './meeting-countdown.component.html',
styleUrls: ['./meeting-countdown.component.css'],
})
export class MeetingCountdownComponent implements OnDestroy {
export class MeetingCountdownComponent implements OnInit, OnDestroy {
@Input({ required: true }) meeting!: MeetingDto;
nextMeetingStr?: string;
timeUntilMeetingInterval: NodeJS.Timeout;
timeUntilMeetingInterval?: NodeJS.Timeout;

constructor() {}

ngOnInit(): void {
this.nextMeetingStr = this.timeUntilMeeting();

constructor() {
this.timeUntilMeetingInterval = setInterval(() => {
this.nextMeetingStr = this.timeUntilMeeting();
}, 1000);
Expand Down

0 comments on commit 58488e2

Please sign in to comment.