Skip to content
This repository was archived by the owner on Jan 6, 2026. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions src/renderer/App.css
Original file line number Diff line number Diff line change
Expand Up @@ -61,3 +61,16 @@ a:hover {
align-items: center;
margin: 20px 0;
}

@keyframes spin {
from {
transform: scale(1) rotate(0deg);
}
to {
transform: scale(1) rotate(360deg);
}
}

.spin {
animation: spin 10s infinite linear;
}
1 change: 1 addition & 0 deletions src/renderer/Footer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,7 @@ const Footer = () => {
theme="monokai"
displayDataTypes={false}
enableClipboard={false}
style={{ overflow: 'auto' }}
/>
<h4>Geth Error Logs</h4>
<ReactJson
Expand Down
19 changes: 15 additions & 4 deletions src/renderer/Header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import { useGetNetworkConnectedQuery } from './state/network';
import { hexToDecimal } from './utils';

const Header = () => {
const [sIsSyncing, setIsSyncing] = useState<boolean>();
const [sSyncPercent, setSyncPercent] = useState<string>('');
const [sPeers, setPeers] = useState<number>();
const qExeuctionIsSyncing = useGetExecutionIsSyncingQuery(null, {
Expand All @@ -26,19 +27,29 @@ const Header = () => {
});

useEffect(() => {
console.log('qExeuctionIsSyncing.data: ', qExeuctionIsSyncing.data);
console.log('qExeuctionIsSyncing: ', qExeuctionIsSyncing);
if (qExeuctionIsSyncing.isError) {
setSyncPercent('');
setIsSyncing(false);
return;
}
const syncingData = qExeuctionIsSyncing.data;
console.log('curr sync: ', syncingData);
if (typeof syncingData === 'object') {
const syncRatio = syncingData.currentBlock / syncingData.highestBlock;
setSyncPercent((syncRatio * 100).toFixed(1));
setIsSyncing(true);
} else {
setSyncPercent('');
setIsSyncing(false);
}
}, [qExeuctionIsSyncing]);

useEffect(() => {
console.log('qExecutionPeers.data: ', qExecutionPeers.data);
console.log('qExecutionPeers: ', qExecutionPeers);
if (qExecutionPeers.isError) {
setPeers(undefined);
return;
}
if (typeof qExecutionPeers.data === 'string') {
setPeers(hexToDecimal(qExecutionPeers.data));
} else {
Expand Down Expand Up @@ -89,7 +100,7 @@ const Header = () => {
alignContent: 'center',
}}
>
<FaSync />
<FaSync className={sIsSyncing ? 'spin' : ''} />
<span style={{ marginLeft: 5, marginRight: 10 }}>
{sSyncPercent}% synced
</span>
Expand Down