Skip to content

Commit

Permalink
Merge pull request #2 from tkey/fix/rss-server-selection
Browse files Browse the repository at this point in the history
fix rss server selection
  • Loading branch information
ieow authored Oct 3, 2023
2 parents d0f9843 + 36af53a commit 1b2c24b
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion packages/core/src/core.ts
Original file line number Diff line number Diff line change
Expand Up @@ -829,7 +829,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),
Expand Down

0 comments on commit 1b2c24b

Please sign in to comment.