Skip to content

Commit

Permalink
Merge pull request #11 from mu373/set-ts-types
Browse files Browse the repository at this point in the history
Set ts types
  • Loading branch information
mu373 authored May 19, 2024
2 parents 4f99be0 + 23b2d94 commit 8776571
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 25 deletions.
2 changes: 1 addition & 1 deletion components/DashboardPanels.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ return (
<dt>Host</dt>
<dd>{formatValue(data.bitcoindHost)}:{formatValue(data.bitcoindPort)}</dd>
<dt>Version</dt>
<dd>{formatValue(data.subversion.replace(/\//g, ""))}</dd>
<dd>{formatValue(data.subversion && data.subversion.replace(/\//g, ""))}</dd>
<dt>Connections</dt>
<dd>{formatValue(data.connectionTotalCount)} ({formatValue(data.connectionInCount)}-in {formatValue(data.connectionOutCount)}-out)</dd>
</dl>
Expand Down
48 changes: 24 additions & 24 deletions pages/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,30 +24,30 @@ const BlockInfo: React.FC<{ defaultDashboardConfig: any }> = ({ defaultDashboard
const [dashboardConfig, setDashboardConfig] = useState(defaultDashboardConfig);

const [dashboardData, setDashboardData] = useState({
bitcoindHost: null,
bitcoindPort: null,
currentBlock: null,
chain: null,
blocks: null,
verificationProgress: null,
chainSize: 0,
pruned: null,
difficulty: null,
mempoolTransactions: null,
mempoolUsage: null,
totalFee: null,
minFee: null,
hashrate: null,
currentChainSize: 0,
subversion: '',
connectionTotalCount: 0,
connectionInCount: 0,
connectionOutCount: 0,
electrumHost: null,
electrumPort: null,
electrumVersion: null,
electrumBlockHeight: null,
syncPercentage: 0,
bitcoindHost: null as string | null,
bitcoindPort: null as number | null,
currentBlock: null as number | null,
chain: null as string | null,
blocks: null as number | null,
verificationProgress: null as number | null,
chainSize: null as number | null,
pruned: null as boolean | null,
difficulty: null as number | null,
mempoolTransactions: null as number | null,
mempoolUsage: null as number | null,
totalFee: null as number | null,
minFee: null as number | null,
hashrate: null as number | null,
currentChainSize: null as number | null,
subversion: null as string | null,
connectionTotalCount: null as number | null,
connectionInCount: null as number | null,
connectionOutCount: null as number | null,
electrumHost: null as string | null,
electrumPort: null as number | null,
electrumVersion: null as string | null,
electrumBlockHeight: null as number | null,
syncPercentage: 0 as number,
});

useEffect(() => {
Expand Down

0 comments on commit 8776571

Please sign in to comment.