Skip to content

Commit

Permalink
Merge pull request #9 from nspcc-dev/fix/7-inaccessible_height
Browse files Browse the repository at this point in the history
  • Loading branch information
roman-khimov authored Feb 17, 2025
2 parents 6613f74 + a30fe03 commit e668694
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
9 changes: 9 additions & 0 deletions src/App.css
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,10 @@ progress::-webkit-progress-value {
background: transparent !important;
}

.tag {
background: transparent !important;
}

.notification a:not(.button):not(.dropdown-item) {
text-decoration: none;
}
Expand Down Expand Up @@ -319,6 +323,11 @@ code {
background: #343942;
}

.tag {
background: transparent !important;
color: #adbac7 !important;
}

.notification.is-primary .subtitle {
color: #fff !important;
}
Expand Down
6 changes: 4 additions & 2 deletions src/Home.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ const Home = ({
}) => {
const [formData, setFormData] = useState<FormData>({
spanStart: 0,
spanEnd: '',
spanEnd: nets[0].maxBlock !== 0 ? nets[0].maxBlock : '',
network: 0,
});

Expand Down Expand Up @@ -65,7 +65,7 @@ const Home = ({

const fetchBlocksInRange = async (retryIndex: number | null = null) => {
if (formData.spanStart === '' || formData.spanEnd === '' || formData.spanEnd < 0) return onModal('failed', 'Insert correct data');
if (formData.spanStart < 0 || formData.spanEnd < 0 || formData.spanStart > nets[formData.network].maxBlock || formData.spanEnd > nets[formData.network].maxBlock) return onModal('failed', 'Insert correct borders');
if (formData.spanStart < 0 || formData.spanEnd < 0 || ((formData.spanStart > nets[formData.network].maxBlock || formData.spanEnd > nets[formData.network].maxBlock) && nets[formData.network].maxBlock !== 0)) return onModal('failed', 'Insert correct borders');


if (retryIndex === null) {
Expand Down Expand Up @@ -134,6 +134,8 @@ const Home = ({
} catch (error: any) {
if (error.message.indexOf('showSaveFilePicker is not a function') !== -1) {
onModal('failed', 'Your current browser does not support this site\'s functionality. For the best experience, please use Chrome 86+ (recommended).', 'about');
} else if (error.message.indexOf('The user aborted a request.') !== -1) {
onModal('failed', 'Aborted by user.');
} else {
onModal('failed', error.message || 'Error occurred during block fetching.', (retryIndexTemp: number) => fetchBlocksInRange(+formData.spanStart + retryIndexTemp));
}
Expand Down

0 comments on commit e668694

Please sign in to comment.