diff --git a/src/app/display/slide-show.service.ts b/src/app/display/slide-show.service.ts index 4ab57e4..033e417 100755 --- a/src/app/display/slide-show.service.ts +++ b/src/app/display/slide-show.service.ts @@ -1,8 +1,8 @@ -import {Injectable} from '@angular/core'; -import {Slide, SlideVisibility} from '../shared/slide'; -import {SlideService} from '../shared/service/slide.service'; -import {Router} from '@angular/router'; -import {SettingsService} from '../shared/service/settings.service'; +import { Injectable } from '@angular/core'; +import { Slide, SlideVisibility } from '../shared/slide'; +import { SlideService } from '../shared/service/slide.service'; +import { Router } from '@angular/router'; +import { SettingsService } from '../shared/service/settings.service'; @Injectable() export class SlideShowService { @@ -18,20 +18,28 @@ export class SlideShowService { } public nextSlide() { - if (this.currentSlideIndex === this.slides.length - 1) { - this.currentSlideIndex++; - this.router.navigate(['/kanban']); - } else if (this.currentSlideIndex === this.slides.length) { - this.currentSlideIndex = -1; - this.reloadSlides(); - this.router.navigate(['/commit-tracker']); - } else { - this.oddEven = !this.oddEven; - this.currentSlideIndex++; - this.router.navigate([ - this.oddEven ? '/slideshow-odd' : '/slideshow-even', - this.slides[this.currentSlideIndex].id - ]); + switch (this.currentSlideIndex) { + case this.slides.length - 1: + this.currentSlideIndex++; + this.router.navigate(['/kanban']); + break; + case this.slides.length: + this.currentSlideIndex++; + this.router.navigate(['/commit-tracker']); + break; + case this.slides.length + 1: + this.currentSlideIndex = -1; + this.reloadSlides(); + this.router.navigate(['/watchers-fixed']); + break; + default: + this.oddEven = !this.oddEven; + this.currentSlideIndex++; + this.router.navigate([ + this.oddEven ? '/slideshow-odd' : '/slideshow-even', + this.slides[this.currentSlideIndex].id + ]); + break; } } diff --git a/src/app/display/watchers/watchers.component.html b/src/app/display/watchers/watchers.component.html index d930a5a..5176cd2 100755 --- a/src/app/display/watchers/watchers.component.html +++ b/src/app/display/watchers/watchers.component.html @@ -31,7 +31,7 @@
{{issue.comment.name}}
{{issue.comment.date}}
-
{{issue.comment.content}}
+
{{issue.comment.content|shortenText:500}}
diff --git a/src/app/shared/service/self-updater.service.ts b/src/app/shared/service/self-updater.service.ts index 2474613..a150f02 100755 --- a/src/app/shared/service/self-updater.service.ts +++ b/src/app/shared/service/self-updater.service.ts @@ -1,12 +1,12 @@ import { Injectable } from '@angular/core'; import { HttpClient } from '@angular/common/http'; -import { Observable } from 'rxjs'; import { Location } from '@angular/common'; +import { Observable } from 'rxjs'; @Injectable() export class SelfUpdaterService { - private appRevision: number = 0; + private appRevision = 0; private initFailed = false; constructor(private httpClient: HttpClient, @@ -16,7 +16,7 @@ export class SelfUpdaterService { () => { console.log( '%c Couldn\'t load initial revision data from server. Self update disabled.', - 'background: #222; color: #bada55;' + 'background: #222; color: #FFC300;' ); this.initFailed = true; } @@ -31,7 +31,11 @@ export class SelfUpdaterService { if (!this.initFailed) { this.getDeployedRevision().subscribe(revision => { if (revision > this.appRevision) { - this.locationService.go('/'); + console.log( + `%c Version change detected (${this.appRevision}=>${revision}), reloading app.`, + 'background: #222; color: #BADA55;' + ); + window.location.reload(true); } }); }