Commit 8b548a24 authored by Zéfling's avatar Zéfling 🎨
Browse files

Unselect current month on quit

parent 817e7f2f
......@@ -42,15 +42,14 @@ export class TweetsCalendarComponent implements OnInit, OnDestroy {
}
ngOnDestroy() {
this.unselectCurrentMouth();
for (const l of this.listener) {
l.unsubscribe();
}
}
show(month: TweetsCalendar) {
if (this.month) {
this.month.selected = false;
}
this.unselectCurrentMouth();
this.month = month;
this.month.selected = true;
......@@ -112,4 +111,10 @@ export class TweetsCalendarComponent implements OnInit, OnDestroy {
testVideo(medias: TweetMedia[]): boolean {
return medias && medias[0].media_url_https.match(/.*\/(tweet_video_thumb|ext_tw_video_thumb)\/.*/) !== null;
}
private unselectCurrentMouth() {
if (this.month) {
this.month.selected = false;
}
}
}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment