From 36af53a80f6c0df33ee13bdac40ea5f30c1b432f Mon Sep 17 00:00:00 2001 From: himanshu Date: Tue, 3 Oct 2023 14:40:02 +0800 Subject: [PATCH] fix rss server selection --- packages/core/src/core.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/packages/core/src/core.ts b/packages/core/src/core.ts index 1ce6246b..d35922e2 100644 --- a/packages/core/src/core.ts +++ b/packages/core/src/core.ts @@ -821,7 +821,11 @@ class ThresholdKey implements ITKey { let finalSelectedServers = selectedServers; if (nodeIndexes?.length > 0) { - finalSelectedServers = nodeIndexes.slice(0, Math.min(selectedServers.length, nodeIndexes.length)); + if (selectedServers.length) { + finalSelectedServers = nodeIndexes.slice(0, Math.min(selectedServers.length, nodeIndexes.length)); + } else { + finalSelectedServers = nodeIndexes.slice(0, 3); + } } else if (selectedServers?.length === 0) { finalSelectedServers = randomSelection( new Array(rssNodeDetails.serverEndpoints.length).fill(null).map((_, i) => i + 1),