Update ui/src/app/app.ts
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This commit is contained in:
parent
c3b2870250
commit
5529a7110f
1 changed files with 7 additions and 1 deletions
|
|
@ -111,7 +111,13 @@ export class App implements AfterViewInit, OnInit {
|
||||||
// Will be set from backend configuration, use empty string as placeholder
|
// Will be set from backend configuration, use empty string as placeholder
|
||||||
this.chapterTemplate = this.cookieService.get('metube_chapter_template') || '';
|
this.chapterTemplate = this.cookieService.get('metube_chapter_template') || '';
|
||||||
this.enableRetryFailed = this.cookieService.get('metube_retry_failed') === 'true';
|
this.enableRetryFailed = this.cookieService.get('metube_retry_failed') === 'true';
|
||||||
this.maxRetryAttempts = parseInt(this.cookieService.get('metube_max_retry_attempts') || '3', 10);
|
const maxRetryCookie = this.cookieService.get('metube_max_retry_attempts');
|
||||||
|
const parsedMaxRetry = parseInt(maxRetryCookie, 10);
|
||||||
|
if (isNaN(parsedMaxRetry) || parsedMaxRetry < 1 || parsedMaxRetry > 10) {
|
||||||
|
this.maxRetryAttempts = 3;
|
||||||
|
} else {
|
||||||
|
this.maxRetryAttempts = parsedMaxRetry;
|
||||||
|
}
|
||||||
|
|
||||||
this.activeTheme = this.getPreferredTheme(this.cookieService);
|
this.activeTheme = this.getPreferredTheme(this.cookieService);
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue