From 5c1f3272c28cf7abe5062c761d8f8816efb72c67 Mon Sep 17 00:00:00 2001 From: Maciej Hirsz <1096222+maciejhirsz@users.noreply.github.com> Date: Wed, 26 Jun 2019 18:20:21 +0200 Subject: [PATCH] feat: pin Alexander as start of telemetry (#156) --- packages/frontend/src/Connection.ts | 5 +++++ packages/frontend/src/components/Chains.tsx | 12 +++++++++++- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/packages/frontend/src/Connection.ts b/packages/frontend/src/Connection.ts index ec35dc0..1db0c65 100644 --- a/packages/frontend/src/Connection.ts +++ b/packages/frontend/src/Connection.ts @@ -403,6 +403,11 @@ export class Connection { let topCount: Types.NodeCount = 0 as Types.NodeCount; for (const [label, count] of chains.entries()) { + if (label === 'Alexander') { + topLabel = label; + break; + } + if (count > topCount) { topLabel = label; topCount = count; diff --git a/packages/frontend/src/components/Chains.tsx b/packages/frontend/src/components/Chains.tsx index 7f29d13..0d54d53 100644 --- a/packages/frontend/src/components/Chains.tsx +++ b/packages/frontend/src/components/Chains.tsx @@ -52,7 +52,17 @@ export class Chains extends React.Component { return stable .inplace( Array.from(this.props.chains.entries()), - (a, b) => b[1] - a[1] + (a, b) => { + if (a[0] === 'Alexander') { + return -1; + } + + if (b[0] === 'Alexander') { + return 1; + } + + return b[1] - a[1]; + } ) .map(([label, nodeCount]) => ({ label, nodeCount })); }