* sanitize the timers a bit
This commit is contained in:
parent
6494c5c75c
commit
0d628456c4
@ -86,13 +86,15 @@ export class AppComponent implements OnInit, OnDestroy {
|
|||||||
let weekDay = now.getDay();
|
let weekDay = now.getDay();
|
||||||
// on weekdays
|
// on weekdays
|
||||||
if (weekDay > 0 && weekDay < 6) {
|
if (weekDay > 0 && weekDay < 6) {
|
||||||
if (now.getHours() == 9 && now.getMinutes() >= 14 && this.autoSwitchEnabled) {
|
if(now.getHours() == 10) {
|
||||||
this.navigateToPage(PAGE_KANBAN);
|
if (this.autoSwitchEnabled && now.getMinutes() > 14) {
|
||||||
this.autoSwitchEnabled = false;
|
this.navigateToPage(PAGE_KANBAN);
|
||||||
}
|
this.autoSwitchEnabled = false;
|
||||||
if (now.getHours() == 9 && now.getMinutes() >= 29 && !this.autoSwitchEnabled) {
|
}
|
||||||
this.navigateToPage(PAGE_TSPINFO);
|
if (!this.autoSwitchEnabled && now.getMinutes() > 30) {
|
||||||
this.autoSwitchEnabled = true;
|
this.navigateToPage(PAGE_TSPINFO);
|
||||||
|
this.autoSwitchEnabled = true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (this.autoSwitchEnabled) {
|
if (this.autoSwitchEnabled) {
|
||||||
|
|||||||
@ -20,7 +20,7 @@ const WIP_LIMIT_VERIFICATION = 8;
|
|||||||
const STYLE_HIDDEN = 'hidden';
|
const STYLE_HIDDEN = 'hidden';
|
||||||
const STYLE_VISIBLE = 'scroll';
|
const STYLE_VISIBLE = 'scroll';
|
||||||
|
|
||||||
const FUN_TIMER = 3000;
|
const FUN_TIMER = 2000;
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-kanban-board',
|
selector: 'app-kanban-board',
|
||||||
@ -32,7 +32,7 @@ export class KanbanBoardComponent implements OnInit, OnDestroy {
|
|||||||
private funTimer: Subscription;
|
private funTimer: Subscription;
|
||||||
|
|
||||||
@HostBinding('style.overflow') hostOverflow = STYLE_HIDDEN;
|
@HostBinding('style.overflow') hostOverflow = STYLE_HIDDEN;
|
||||||
public showSomeFun: boolean = true;
|
public showSomeFun: boolean = false;
|
||||||
|
|
||||||
constructor(private titleService: Title,
|
constructor(private titleService: Title,
|
||||||
private route: ActivatedRoute,
|
private route: ActivatedRoute,
|
||||||
@ -52,16 +52,14 @@ export class KanbanBoardComponent implements OnInit, OnDestroy {
|
|||||||
this.kanbanBoard = data.kanbanBoard;
|
this.kanbanBoard = data.kanbanBoard;
|
||||||
this.fun = data.fun;
|
this.fun = data.fun;
|
||||||
});
|
});
|
||||||
|
this.lunchTime();
|
||||||
let timer0 = TimerObservable.create(FUN_TIMER, FUN_TIMER);
|
let timer0 = TimerObservable.create(FUN_TIMER, FUN_TIMER);
|
||||||
this.funTimer = timer0.subscribe(() => {
|
this.funTimer = timer0.subscribe(() => this.lunchTime.bind(this));
|
||||||
let now = new Date();
|
}
|
||||||
if((now.getHours() == 10 && now.getMinutes() > 28) || (now.getHours() == 11 && now.getMinutes() < 30)) {
|
|
||||||
this.showSomeFun = true;
|
private lunchTime() {
|
||||||
} else {
|
let now = new Date();
|
||||||
this.showSomeFun = false;
|
this.showSomeFun = (now.getHours() == 11 && now.getMinutes() > 29) || (now.getHours() == 12 && now.getMinutes() < 31);
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ngOnDestroy() {
|
ngOnDestroy() {
|
||||||
|
|||||||
@ -1,4 +1,3 @@
|
|||||||
<div class="widget camera">
|
<div class="widget camera">
|
||||||
<img [src]="cameraUrls[0]">
|
<img *ngFor="let src of cameraUrls" [src]="src">
|
||||||
<img [src]="cameraUrls[1]">
|
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user