diff --git a/src/app/app.component.ts b/src/app/app.component.ts index 9701da0..2fdcb4e 100644 --- a/src/app/app.component.ts +++ b/src/app/app.component.ts @@ -86,13 +86,15 @@ export class AppComponent implements OnInit, OnDestroy { let weekDay = now.getDay(); // on weekdays if (weekDay > 0 && weekDay < 6) { - if (now.getHours() == 9 && now.getMinutes() >= 14 && this.autoSwitchEnabled) { - this.navigateToPage(PAGE_KANBAN); - this.autoSwitchEnabled = false; - } - if (now.getHours() == 9 && now.getMinutes() >= 29 && !this.autoSwitchEnabled) { - this.navigateToPage(PAGE_TSPINFO); - this.autoSwitchEnabled = true; + if(now.getHours() == 10) { + if (this.autoSwitchEnabled && now.getMinutes() > 14) { + this.navigateToPage(PAGE_KANBAN); + this.autoSwitchEnabled = false; + } + if (!this.autoSwitchEnabled && now.getMinutes() > 30) { + this.navigateToPage(PAGE_TSPINFO); + this.autoSwitchEnabled = true; + } } } if (this.autoSwitchEnabled) { diff --git a/src/app/kanban/kanban-board/kanban-board.component.ts b/src/app/kanban/kanban-board/kanban-board.component.ts index 44b3708..0240805 100644 --- a/src/app/kanban/kanban-board/kanban-board.component.ts +++ b/src/app/kanban/kanban-board/kanban-board.component.ts @@ -20,7 +20,7 @@ const WIP_LIMIT_VERIFICATION = 8; const STYLE_HIDDEN = 'hidden'; const STYLE_VISIBLE = 'scroll'; -const FUN_TIMER = 3000; +const FUN_TIMER = 2000; @Component({ selector: 'app-kanban-board', @@ -32,7 +32,7 @@ export class KanbanBoardComponent implements OnInit, OnDestroy { private funTimer: Subscription; @HostBinding('style.overflow') hostOverflow = STYLE_HIDDEN; - public showSomeFun: boolean = true; + public showSomeFun: boolean = false; constructor(private titleService: Title, private route: ActivatedRoute, @@ -52,16 +52,14 @@ export class KanbanBoardComponent implements OnInit, OnDestroy { this.kanbanBoard = data.kanbanBoard; this.fun = data.fun; }); - + this.lunchTime(); let timer0 = TimerObservable.create(FUN_TIMER, FUN_TIMER); - this.funTimer = timer0.subscribe(() => { - let now = new Date(); - if((now.getHours() == 10 && now.getMinutes() > 28) || (now.getHours() == 11 && now.getMinutes() < 30)) { - this.showSomeFun = true; - } else { - this.showSomeFun = false; - } - }); + this.funTimer = timer0.subscribe(() => this.lunchTime.bind(this)); + } + + private lunchTime() { + let now = new Date(); + this.showSomeFun = (now.getHours() == 11 && now.getMinutes() > 29) || (now.getHours() == 12 && now.getMinutes() < 31); } ngOnDestroy() { diff --git a/src/app/tsp-info/animgif/animgif.component.html b/src/app/tsp-info/animgif/animgif.component.html index da25e26..1dbaf2d 100644 --- a/src/app/tsp-info/animgif/animgif.component.html +++ b/src/app/tsp-info/animgif/animgif.component.html @@ -1,4 +1,3 @@