v0.2.76
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
/*
|
||||
* Copyright (C) 2026 Mateusz Gruszczyński @linuxiarz.pl
|
||||
* Source-Available Code / Dual-Licensed.
|
||||
*
|
||||
* Free for non-commercial and evaluation use under terms of BSL/GPLv3.
|
||||
* Commercial or production use requires a valid paid license.
|
||||
* See LICENSE file in repository root for details.
|
||||
*/
|
||||
|
||||
export const CONNECTION_ERROR_AFTER_RECONNECT_ATTEMPTS = 5;
|
||||
|
||||
export function reconnectStatus(attempt, networkOnline = true) {
|
||||
const normalizedAttempt = Math.max(0, Number(attempt) || 0);
|
||||
if (!networkOnline || normalizedAttempt < CONNECTION_ERROR_AFTER_RECONNECT_ATTEMPTS) return "reconnecting";
|
||||
return "error";
|
||||
}
|
||||
Reference in New Issue
Block a user