From 4ce5a5f28b1e169de475df36d4d19d1cd09c0ac4 Mon Sep 17 00:00:00 2001 From: Shiva Sai K <129726163+shiva-sai-824@users.noreply.github.com> Date: Sun, 4 Jan 2026 19:47:15 +0530 Subject: [PATCH] Update ui/src/app/app.ts Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- ui/src/app/app.ts | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/ui/src/app/app.ts b/ui/src/app/app.ts index e4f4cc9..be186d0 100644 --- a/ui/src/app/app.ts +++ b/ui/src/app/app.ts @@ -296,12 +296,22 @@ export class App implements AfterViewInit, OnInit { } maxRetryAttemptsChanged() { - // Ensure value is between 1 and 10 - if (this.maxRetryAttempts < 1) { - this.maxRetryAttempts = 1; - } else if (this.maxRetryAttempts > 10) { - this.maxRetryAttempts = 10; + // Ensure value is a valid integer between 1 and 10 + let attempts = Number(this.maxRetryAttempts); + + if (!Number.isFinite(attempts)) { + attempts = 1; } + + attempts = Math.round(attempts); + + if (attempts < 1) { + attempts = 1; + } else if (attempts > 10) { + attempts = 10; + } + + this.maxRetryAttempts = attempts; this.cookieService.set('metube_max_retry_attempts', this.maxRetryAttempts.toString(), { expires: 3650 }); }