From 8441a19f638a105fe2738b28ef6b5da0b4610a0e Mon Sep 17 00:00:00 2001 From: Mikhail Petrov Date: Mon, 22 Jan 2024 17:18:53 +0300 Subject: [PATCH 1/3] web-fix: Add error handle for creation object Signed-off-by: Mikhail Petrov --- src/App.js | 2 ++ src/api.js | 2 ++ 2 files changed, 4 insertions(+) diff --git a/src/App.js b/src/App.js index b09c118..4afbe65 100644 --- a/src/App.js +++ b/src/App.js @@ -439,6 +439,8 @@ export const App = () => { loading: false, }); } + }).catch((err) => { + onModal('failed', `Something went wrong: ${err}`); }); } else { setError({ active: true, type: ['attributes'], text: 'Attributes should not be empty.' }); diff --git a/src/api.js b/src/api.js index 56bdda5..594eaeb 100644 --- a/src/api.js +++ b/src/api.js @@ -31,6 +31,8 @@ export default function api(method, url, params = {}, headers = {}) { res = await response.blob(); const header = response.headers.get('Content-Type'); resolve({ header, res }); + } else if (response.status === 413) { + reject('413 Request Entity Too Large'); } else if (response) { res = await response.json(); resolve(res); From 10315f84ba3cf9e53ee71e37dfa6721e69df8502 Mon Sep 17 00:00:00 2001 From: Mikhail Petrov Date: Mon, 22 Jan 2024 17:19:08 +0300 Subject: [PATCH 2/3] web-fix: Add error handle for updating neo balance Signed-off-by: Mikhail Petrov --- src/Profile.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/Profile.js b/src/Profile.js index 1a1deee..7e47d88 100644 --- a/src/Profile.js +++ b/src/Profile.js @@ -116,14 +116,16 @@ const Profile = ({ } }); setIsLoadingNeoBalance(false); - if (!response.error && response.stack.length > 0) { + if (response && !response.error && response.stack.length > 0) { onPopup('success', 'Mainnet balance has been updated'); setNeoBalance(response.stack[0].value); setTimeout(() => { setIsLoadingNeoBalance(false); }, 500); - } else if (response.exception) { + } else if (response && response.exception) { onPopup('failed', response.exception); + } else { + onPopup('failed', 'Something went wrong'); } }; From 74ec3c66880ca282696e2d09a49c94d7982adcc5 Mon Sep 17 00:00:00 2001 From: Mikhail Petrov Date: Mon, 22 Jan 2024 17:19:34 +0300 Subject: [PATCH 3/3] web-fix: Long file name fits in the screen, closes #136 Signed-off-by: Mikhail Petrov --- src/App.css | 1 + 1 file changed, 1 insertion(+) diff --git a/src/App.css b/src/App.css index 68b1b62..894bf79 100644 --- a/src/App.css +++ b/src/App.css @@ -313,6 +313,7 @@ label.panel-block:hover { .objects_tree_file .file--label span { margin-left: 5px; cursor: pointer; + word-break: break-word; } .objects_tree_folder .folder_collapsible,