Compare commits

...
Author SHA1 Message Date
Matthew Russell 2142ba5d34 fix: add a timeout to show subscriptions as failed 2023-03-02 22:10:25 -08:00
dexturr 93dbc32f22 chore: update tranches
Signed-off-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2023-03-03 01:56:44 +00:00
dexturr fd1827ef67 chore: update tranches
Signed-off-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2023-03-02 18:09:24 +00:00
Sam Keen 9c9948e4c1 feat(governance): final wallet not connected views (#3037) 2023-03-02 14:36:04 +00:00
Sam Keen 79b0868ff7 feat(governance): remove graph from tranches page (#3049) 2023-03-02 14:35:46 +00:00
8 changed files with 134 additions and 207 deletions
@@ -11,7 +11,7 @@ export const EthConnectPrompt = () => {
const { appDispatch } = useAppState();
return (
<Button
variant="primary"
variant="default"
onClick={() =>
appDispatch({
type: AppStateActionType.SET_ETH_WALLET_OVERLAY,
@@ -336,6 +336,7 @@
"withdrawLpNoneDeposited": "You have no SLP tokens deposited or rewards accumulated",
"withdrawAllLpSuccessCalloutTitle": "Your SLP tokens and rewards have been sent to your Ethereum address",
"Dissociate VEGA tokens": "Disassociate $VEGA tokens",
"DisassociateVegaTokensFromWallet": "Disassociate $VEGA tokens from your Vega wallet",
"Early Investors": "Early Investors",
"Team": "Team",
"Community": "Community",
@@ -482,6 +483,7 @@
"withdrawFormSubmitButtonIdle": "Withdraw {{amount}} {{symbol}} tokens",
"withdrawFormSubmitButtonPending": "Preparing",
"withdrawalsTitle": "Withdrawals",
"withdrawalsSubtitle": "Connect your Vega wallet to complete a withdrawal. These withdrawals will be completed with an Ethereum transaction.",
"withdrawalsText": "These withdrawals need to be completed with an Ethereum transaction.",
"withdrawalsNone": "You don't have any pending withdrawals.",
"withdrawalsCompleteButton": "Finish withdrawal",
@@ -552,9 +554,6 @@
"resourceNotFound": "Resource Not Found",
"Or": "Or",
"addTokenToWallet": "Show this token in your Ethereum wallet",
"chartBelow": "*Certain activities, for example community incentive tokens, do not have specific dates to be credited and so an approximation has been used. ",
"chartTitle": "Token unlocking schedule",
"chartAbove": "This chart shows the approximate* schedule for how tokens will unlock from vesting tranches over time.",
"date": "Date",
"noEthereumProviderError": "No Ethereum browser extension detected, install MetaMask on desktop or visit from a dApp browser on mobile",
"unsupportedChainIdError": "You're connected to an unsupported network",
@@ -15,7 +15,12 @@ export const DisassociateContainer = () => {
<>
<Heading title={t('pageTitleDisassociate')} />
{!account ? (
<EthConnectPrompt />
<>
<p className="mb-8">{t('DisassociateVegaTokensFromWallet')}</p>
<div className="max-w-[400px]">
<EthConnectPrompt />
</div>
</>
) : (
<DisassociatePage address={account} vegaKey={pubKey ?? ''} />
)}
@@ -1,15 +1,12 @@
import { useWeb3React } from '@web3-react/core';
import React from 'react';
import { useState } from 'react';
import { useTranslation } from 'react-i18next';
import { SubHeading } from '../../components/heading';
import { TrancheItem } from '../redemption/tranche-item';
import { TrancheLabel } from './tranche-label';
import { VestingChart } from './vesting-chart';
import { ButtonLink } from '@vegaprotocol/ui-toolkit';
import { useEthereumConfig } from '@vegaprotocol/web3';
import type { Tranche } from '../../lib/tranches/tranches-store';
import { TrancheItem } from '../redemption/tranche-item';
import { TrancheLabel } from './tranche-label';
import { useTranches } from '../../lib/tranches/tranches-store';
import type { Tranche } from '../../lib/tranches/tranches-store';
const trancheMinimum = 10;
@@ -18,7 +15,7 @@ const shouldShowTranche = (t: Tranche) =>
export const Tranches = () => {
const tranches = useTranches((state) => state.tranches);
const [showAll, setShowAll] = React.useState<boolean>(false);
const [showAll, setShowAll] = useState<boolean>(false);
const { t } = useTranslation();
const { chainId } = useWeb3React();
const { config } = useEthereumConfig();
@@ -30,10 +27,6 @@ export const Tranches = () => {
return (
<section>
<SubHeading title={t('chartTitle')} />
<p>{t('chartAbove')}</p>
<VestingChart />
<p>{t('chartBelow')}</p>
{tranches?.length ? (
<ul role="list">
{(showAll ? tranches : filteredTranches).map((tranche) => {
@@ -55,6 +48,7 @@ export const Tranches = () => {
) : (
<p>{t('No tranches')}</p>
)}
<section className="text-center mt-4">
<ButtonLink onClick={() => setShowAll(!showAll)}>
{showAll
@@ -1,149 +0,0 @@
import { format, startOfMonth } from 'date-fns';
import React from 'react';
import { useTranslation } from 'react-i18next';
import {
Area,
AreaChart,
Label,
Legend,
ReferenceLine,
ResponsiveContainer,
Tooltip,
XAxis,
YAxis,
} from 'recharts';
import colors from 'tailwindcss/colors';
import { DATE_FORMAT_LONG } from '../../lib/date-formats';
import data from './data.json';
import { theme } from '@vegaprotocol/tailwindcss-config';
const Colors = theme.colors;
const ORDER = ['community', 'publicSale', 'earlyInvestors', 'team'];
export const VestingChart = () => {
const { t } = useTranslation();
const currentDate = React.useMemo(
() => format(startOfMonth(new Date()), DATE_FORMAT_LONG),
[]
);
return (
<div style={{ marginBottom: 25 }}>
<ResponsiveContainer height={400} width="100%">
<AreaChart data={data}>
<defs>
{[
['pink', Colors.vega.pink.DEFAULT],
['green', Colors.vega.green.DEFAULT],
['orange', Colors.warning],
['yellow', Colors.vega.yellow.DEFAULT],
].map(([key, color]) => (
<linearGradient key={key} id={key} x1="0" y1="0" x2="0" y2="1">
<stop offset="0%" stopColor={color} stopOpacity={0.85} />
<stop offset="100%" stopColor={color} stopOpacity={0} />
</linearGradient>
))}
</defs>
<Tooltip
contentStyle={{ backgroundColor: colors.black }}
separator=":"
// @ts-ignore formatter doesnt seem to allow returning JSX but nonetheless it works
formatter={(value: number) => {
return (
<div
style={{
display: 'flex',
textAlign: 'right',
}}
>
{Intl.NumberFormat().format(value)}
</div>
);
}}
// eslint-disable-next-line @typescript-eslint/no-explicit-any
itemSorter={(label: any) => {
return ORDER.indexOf(label.dataKey) + 1;
}}
/>
<YAxis type="number" width={100}>
<Label
angle={270}
value={t('VEGA').toString()}
position="left"
offset={-5}
fill={colors.white}
/>
</YAxis>
<XAxis dataKey="date">
<Label
value={t('date').toString()}
position="bottom"
offset={5}
fill={colors.white}
/>
</XAxis>
<ReferenceLine
x={currentDate}
stroke={colors.white}
strokeWidth={2}
label={{
position: 'left',
value: currentDate,
fill: colors.white,
}}
/>
<Area
dot={false}
type="linear"
dataKey="team"
stroke={Colors.vega.pink.DEFAULT}
fill="url(#pink)"
yAxisId={0}
strokeWidth={2}
fillOpacity={0.85}
stackId="1"
name={t('Team')}
/>
<Area
dot={false}
type="monotone"
dataKey="earlyInvestors"
stroke={Colors.vega.green.DEFAULT}
fill="url(#green)"
yAxisId={0}
strokeWidth={2}
fillOpacity={0.85}
stackId="1"
name={t('Early Investors')}
/>
<Area
dot={false}
type="monotone"
dataKey="publicSale"
stroke={Colors.vega.yellow.DEFAULT}
fill="url(#yellow)"
yAxisId={0}
strokeWidth={2}
stackId="1"
fillOpacity={0.85}
name={t('Public Sale')}
/>
<Area
dot={false}
type="monotone"
dataKey="community"
stroke={Colors.warning}
fill="url(#orange)"
yAxisId={0}
strokeWidth={2}
fillOpacity={0.85}
stackId="1"
name={t('Community')}
/>
<Legend wrapperStyle={{ position: 'relative' }} />
</AreaChart>
</ResponsiveContainer>
</div>
);
};
@@ -17,12 +17,14 @@ import type { RouteChildProps } from '../index';
const Withdrawals = ({ name }: RouteChildProps) => {
useDocumentTitle(name);
const { t } = useTranslation();
const { pubKey } = useVegaWallet();
return (
<>
<Heading title={t('withdrawalsTitle')} />
{!pubKey && <p className="mb-8">{t('withdrawalsSubtitle')}</p>}
<VegaWalletContainer>
{(currVegaKey) => <WithdrawPendingContainer />}
{() => <WithdrawPendingContainer />}
</VegaWalletContainer>
</>
);
+89 -34
View File
@@ -2761,7 +2761,7 @@
"tranche_end": "2023-12-05T00:00:00.000Z",
"total_added": "86666.297",
"total_removed": "0",
"locked_amount": "65888.8190337497085175298",
"locked_amount": "65752.1635199045224671036",
"deposits": [
{
"amount": "86666.297",
@@ -2827,7 +2827,7 @@
"tranche_end": "2023-06-01T00:00:00.000Z",
"total_added": "2500",
"total_removed": "0",
"locked_amount": "1243.0560325091575",
"locked_amount": "1235.1503675722425",
"deposits": [
{
"amount": "2500",
@@ -2948,7 +2948,7 @@
"tranche_end": "2023-09-01T00:00:00.000Z",
"total_added": "17500",
"total_removed": "0",
"locked_amount": "17356.8118772644925",
"locked_amount": "17302.07374069041875",
"deposits": [
{
"amount": "12500",
@@ -3214,8 +3214,8 @@
"tranche_start": "2023-02-01T00:00:00.000Z",
"tranche_end": "2023-08-01T00:00:00.000Z",
"total_added": "37500",
"total_removed": "3451.5629793",
"locked_amount": "31386.97772790055125",
"total_removed": "3500.377436025",
"locked_amount": "31267.73758824432375",
"deposits": [
{
"amount": "7500",
@@ -3244,6 +3244,11 @@
"user": "0x20CD77B9FC2f1fEDfb6F184E25f7127BFE991C8b",
"tx": "0x7d9d6e2a37fbe030faf08b7b1b0fc5b09f1f4295c4d7f4e28e0bdac1bdd294ac"
},
{
"amount": "48.814456725",
"user": "0x20CD77B9FC2f1fEDfb6F184E25f7127BFE991C8b",
"tx": "0x9e42c457fa017043dbbcb189fb3a574719ce66ce348eee850db3bd809014b1fd"
},
{
"amount": "142.173112275",
"user": "0x20CD77B9FC2f1fEDfb6F184E25f7127BFE991C8b",
@@ -3310,6 +3315,12 @@
"tranche_id": 34,
"tx": "0x7d9d6e2a37fbe030faf08b7b1b0fc5b09f1f4295c4d7f4e28e0bdac1bdd294ac"
},
{
"amount": "48.814456725",
"user": "0x20CD77B9FC2f1fEDfb6F184E25f7127BFE991C8b",
"tranche_id": 34,
"tx": "0x9e42c457fa017043dbbcb189fb3a574719ce66ce348eee850db3bd809014b1fd"
},
{
"amount": "142.173112275",
"user": "0x20CD77B9FC2f1fEDfb6F184E25f7127BFE991C8b",
@@ -3348,8 +3359,8 @@
}
],
"total_tokens": "7500",
"withdrawn_tokens": "1176.4497966",
"remaining_tokens": "6323.5502034"
"withdrawn_tokens": "1225.264253325",
"remaining_tokens": "6274.735746675"
},
{
"address": "0x0B4e6fcE839B01ef43DA6F890FAC7B1Afb004600",
@@ -3381,7 +3392,7 @@
"tranche_end": "2023-12-05T00:00:00.000Z",
"total_added": "129999.45",
"total_removed": "0",
"locked_amount": "65828.703776830530732315",
"locked_amount": "65692.1729439470503785",
"deposits": [
{
"amount": "129999.45",
@@ -3447,7 +3458,7 @@
"tranche_end": "2023-09-03T00:00:00.000Z",
"total_added": "62600",
"total_removed": "0",
"locked_amount": "31642.06683789954558",
"locked_amount": "31543.35908802638962",
"deposits": [
{
"amount": "10000",
@@ -3640,7 +3651,7 @@
"tranche_end": "2023-09-17T00:00:00.000Z",
"total_added": "5000",
"total_removed": "0",
"locked_amount": "2719.1024543378995",
"locked_amount": "2711.2184487569765",
"deposits": [
{
"amount": "5000",
@@ -3851,7 +3862,7 @@
"tranche_end": "2023-04-05T00:00:00.000Z",
"total_added": "97499.58",
"total_removed": "0",
"locked_amount": "7794.0278068466617184238",
"locked_amount": "7660.1037782103571237062",
"deposits": [
{
"amount": "97499.58",
@@ -3884,7 +3895,7 @@
"tranche_end": "2023-04-05T00:00:00.000Z",
"total_added": "135173.4239508",
"total_removed": "98230.390980249184455396",
"locked_amount": "10653.090429193107744542476008",
"locked_amount": "10470.039403066276125235594836",
"deposits": [
{
"amount": "135173.4239508",
@@ -3930,7 +3941,7 @@
"tranche_end": "2023-04-05T00:00:00.000Z",
"total_added": "32499.86",
"total_removed": "0",
"locked_amount": "3278.8129026794692276046",
"locked_amount": "3222.4733765764461183784",
"deposits": [
{
"amount": "32499.86",
@@ -3963,7 +3974,7 @@
"tranche_end": "2023-04-05T00:00:00.000Z",
"total_added": "10833.29",
"total_removed": "0",
"locked_amount": "1067.221782974876983662",
"locked_amount": "1048.8838139341641135251",
"deposits": [
{
"amount": "10833.29",
@@ -3996,7 +4007,7 @@
"tranche_end": "2023-04-05T00:00:00.000Z",
"total_added": "22749.93",
"total_removed": "4720.860935375",
"locked_amount": "3989.5133844404452945716",
"locked_amount": "3920.9619604548439563678",
"deposits": [
{
"amount": "6500",
@@ -4147,8 +4158,8 @@
"tranche_start": "2022-11-01T00:00:00.000Z",
"tranche_end": "2023-05-01T00:00:00.000Z",
"total_added": "22500",
"total_removed": "4988.60449275",
"locked_amount": "7395.722548342542",
"total_removed": "5037.424704525",
"locked_amount": "7324.17846454880325",
"deposits": [
{
"amount": "7500",
@@ -4177,6 +4188,11 @@
"user": "0x20CD77B9FC2f1fEDfb6F184E25f7127BFE991C8b",
"tx": "0x27d0868963dc1e725d9b4da891a4df20b48107f1b0c803dd3f752362aa1d4335"
},
{
"amount": "48.820211775",
"user": "0x20CD77B9FC2f1fEDfb6F184E25f7127BFE991C8b",
"tx": "0x1690b7e9232984baf6a441b517de44cb2c9c547f100e9e8acc8d7e144e01b2b8"
},
{
"amount": "142.17311235",
"user": "0x20CD77B9FC2f1fEDfb6F184E25f7127BFE991C8b",
@@ -4298,6 +4314,12 @@
"tranche_id": 33,
"tx": "0x27d0868963dc1e725d9b4da891a4df20b48107f1b0c803dd3f752362aa1d4335"
},
{
"amount": "48.820211775",
"user": "0x20CD77B9FC2f1fEDfb6F184E25f7127BFE991C8b",
"tranche_id": 33,
"tx": "0x1690b7e9232984baf6a441b517de44cb2c9c547f100e9e8acc8d7e144e01b2b8"
},
{
"amount": "142.17311235",
"user": "0x20CD77B9FC2f1fEDfb6F184E25f7127BFE991C8b",
@@ -4408,8 +4430,8 @@
}
],
"total_tokens": "7500",
"withdrawn_tokens": "4988.60449275",
"remaining_tokens": "2511.39550725"
"withdrawn_tokens": "5037.424704525",
"remaining_tokens": "2462.575295475"
},
{
"address": "0x2539b51EbDE65a75672aBcfE9439a706a99D18D1",
@@ -4434,7 +4456,7 @@
"tranche_end": "2023-06-02T00:00:00.000Z",
"total_added": "1939928.38",
"total_removed": "928642.9598472029154",
"locked_amount": "486281.47054448047845174",
"locked_amount": "483222.589309578295592792",
"deposits": [
{
"amount": "1852091.69",
@@ -36814,7 +36836,7 @@
"tranche_end": "2023-06-05T00:00:00.000Z",
"total_added": "3732368.4671",
"total_removed": "618385.665327542135993",
"locked_amount": "771746.63973020695967996929",
"locked_amount": "767046.204261494651069018807",
"deposits": [
{
"amount": "1998.95815",
@@ -38173,8 +38195,8 @@
"tranche_start": "2022-06-05T00:00:00.000Z",
"tranche_end": "2023-12-05T00:00:00.000Z",
"total_added": "15870102.715470999700000001",
"total_removed": "586757.93761874998960452",
"locked_amount": "8036251.6192538834556613842019307768004867",
"total_removed": "587055.52353142020335452",
"locked_amount": "8019584.17687863003095029918098754518113",
"deposits": [
{
"amount": "16249.93",
@@ -38738,6 +38760,11 @@
"user": "0xF4c75FdbAe821C6B5DBB9f001bB23cBA58D1bA37",
"tx": "0x132a15c0b5f8c6016ac1a90437b9dca119ebc2479cde9c702327653fa3c11750"
},
{
"amount": "297.58591267021375",
"user": "0x20CD77B9FC2f1fEDfb6F184E25f7127BFE991C8b",
"tx": "0x7fa0448cd21e20e3a40743d0f294b6d83618e5167b83809c1c91a82afaba57a5"
},
{
"amount": "535.4042378778335",
"user": "0x20CD77B9FC2f1fEDfb6F184E25f7127BFE991C8b",
@@ -40537,6 +40564,12 @@
"tranche_id": 2,
"tx": "0xdbd9367c0d60c1bd9165752d8fab223aa43c7c2e85568a4e98e86ad0e0c97a01"
},
{
"amount": "297.58591267021375",
"user": "0x20CD77B9FC2f1fEDfb6F184E25f7127BFE991C8b",
"tranche_id": 2,
"tx": "0x7fa0448cd21e20e3a40743d0f294b6d83618e5167b83809c1c91a82afaba57a5"
},
{
"amount": "535.4042378778335",
"user": "0x20CD77B9FC2f1fEDfb6F184E25f7127BFE991C8b",
@@ -41751,8 +41784,8 @@
}
],
"total_tokens": "259998.8875",
"withdrawn_tokens": "128074.4211493107955",
"remaining_tokens": "131924.4663506892045"
"withdrawn_tokens": "128372.00706198100925",
"remaining_tokens": "131626.88043801899075"
},
{
"address": "0x89051CAb67Bc7F8CC44F7e270c6EDaf1EC57676c",
@@ -44025,8 +44058,8 @@
"tranche_start": "2021-11-05T00:00:00.000Z",
"tranche_end": "2023-05-05T00:00:00.000Z",
"total_added": "14597706.0446472999",
"total_removed": "5578092.828988683569444906",
"locked_amount": "1697570.95665381351801300648336951",
"total_removed": "5578506.105997036447643656",
"locked_amount": "1682183.680275606109201953939978039",
"deposits": [
{
"amount": "129284.449",
@@ -44265,6 +44298,11 @@
"user": "0x4Aa3c35F6CC2d507E5C18205ee57099A4C80B19b",
"tx": "0xbecb2d5ad72cdfe972b450c388f111d9262c39896c71acceecb5f672e50c3ce9"
},
{
"amount": "413.27700835287819875",
"user": "0x4Aa3c35F6CC2d507E5C18205ee57099A4C80B19b",
"tx": "0xa266ac6aa7627d396b9d1c668f80e26d95de431e9ed861922df4472e9158204b"
},
{
"amount": "800.792718381487871",
"user": "0x4Aa3c35F6CC2d507E5C18205ee57099A4C80B19b",
@@ -47256,6 +47294,12 @@
"tranche_id": 3,
"tx": "0xbecb2d5ad72cdfe972b450c388f111d9262c39896c71acceecb5f672e50c3ce9"
},
{
"amount": "413.27700835287819875",
"user": "0x4Aa3c35F6CC2d507E5C18205ee57099A4C80B19b",
"tranche_id": 3,
"tx": "0xa266ac6aa7627d396b9d1c668f80e26d95de431e9ed861922df4472e9158204b"
},
{
"amount": "800.792718381487871",
"user": "0x4Aa3c35F6CC2d507E5C18205ee57099A4C80B19b",
@@ -49772,8 +49816,8 @@
}
],
"total_tokens": "359123.469575",
"withdrawn_tokens": "316989.8526581766944315",
"remaining_tokens": "42133.6169168233055685"
"withdrawn_tokens": "317403.12966652957263025",
"remaining_tokens": "41720.33990847042736975"
},
{
"address": "0xBdd412797c1B78535Afc5F71503b91fAbD0160fB",
@@ -51117,7 +51161,7 @@
"tranche_end": "2023-04-05T00:00:00.000Z",
"total_added": "5778205.3912159303",
"total_removed": "3077573.36197477479025324",
"locked_amount": "353817.1482574094718858681604364422",
"locked_amount": "347737.542298906744323236374749015",
"deposits": [
{
"amount": "552496.6455",
@@ -53188,8 +53232,8 @@
"tranche_start": "2022-06-05T00:00:00.000Z",
"tranche_end": "2023-06-05T00:00:00.000Z",
"total_added": "472355.6199999996",
"total_removed": "34992.4553336210685",
"locked_amount": "122287.66655711750460814439269404",
"total_removed": "35033.4420916090685",
"locked_amount": "121542.855688265356170957439167948",
"deposits": [
{
"amount": "3000",
@@ -59843,6 +59887,11 @@
"user": "0x454D87e666a106F3545B7cde91F32aE8B9616a72",
"tx": "0xcefe8932dc5a8ef8bbbb4f4ac1ec86c2de0e064cab91c381e222411c4661d34a"
},
{
"amount": "40.986757988",
"user": "0xf751033D4e6864a88Be93E36258246F26AEf577c",
"tx": "0x2f4a8c1de411b2a4c858e06633748bd342c23e0ad30910fc30d562f59c86de36"
},
{
"amount": "57.900076104",
"user": "0x96d882E908C06cD697Ea07266Fb8D14ae129A50b",
@@ -78434,6 +78483,12 @@
}
],
"withdrawals": [
{
"amount": "40.986757988",
"user": "0xf751033D4e6864a88Be93E36258246F26AEf577c",
"tranche_id": 5,
"tx": "0x2f4a8c1de411b2a4c858e06633748bd342c23e0ad30910fc30d562f59c86de36"
},
{
"amount": "108.551141552",
"user": "0xf751033D4e6864a88Be93E36258246F26AEf577c",
@@ -78448,8 +78503,8 @@
}
],
"total_tokens": "400",
"withdrawn_tokens": "255.898008624",
"remaining_tokens": "144.101991376"
"withdrawn_tokens": "296.884766612",
"remaining_tokens": "103.115233388"
},
{
"address": "0x667ee9816155807e4120dba069CC42aED064399b",
@@ -27,6 +27,7 @@ export const RowData = ({
highestBlock,
onBlockHeight,
}: RowDataProps) => {
const [subFailed, setSubFailed] = useState(false);
const [time, setTime] = useState<number>();
// no use of data here as we need the data nodes reference to block height
const { data, error, loading, startPolling, stopPolling } =
@@ -46,9 +47,18 @@ export const RowData = ({
} = useBlockTimeSubscription();
useEffect(() => {
// stop polling if row has errored
}, [error, stopPolling]);
const timeout = setTimeout(() => {
if (!subData) {
setSubFailed(true);
}
}, 3000);
return () => {
clearTimeout(timeout);
};
}, [subData]);
// handle polling
useEffect(() => {
const handleStartPoll = () => startPolling(POLL_INTERVAL);
const handleStopPoll = () => stopPolling();
@@ -68,6 +78,7 @@ export const RowData = ({
};
}, [startPolling, stopPolling, error]);
// measure response time
useEffect(() => {
if (!isValidUrl(url)) return;
// every time we get data measure response speed
@@ -131,6 +142,15 @@ export const RowData = ({
return false;
};
const getSubFailed = (
subError: ApolloError | undefined,
subFailed: boolean
) => {
if (subError) return true;
if (subFailed) return true;
return false;
};
return (
<>
{id !== CUSTOM_NODE_KEY && (
@@ -161,11 +181,11 @@ export const RowData = ({
</LayoutCell>
<LayoutCell
label={t('Subscription')}
isLoading={subLoading}
hasError={Boolean(subError)}
isLoading={subFailed ? false : subLoading}
hasError={getSubFailed(subError, subFailed)}
dataTestId="subscription-cell"
>
{getSubscriptionDisplayValue(subData?.busEvents, subError)}
{getSubscriptionDisplayValue(subFailed, subData?.busEvents, subError)}
</LayoutCell>
</>
);
@@ -195,10 +215,11 @@ const getBlockDisplayValue = (block?: number, error?: ApolloError) => {
};
const getSubscriptionDisplayValue = (
subFailed: boolean,
events?: { id: string }[] | null,
error?: ApolloError
) => {
if (error) {
if (subFailed || error) {
return t('No');
}
if (events?.length) {