Don't display status code twice in UI errors

This commit is contained in:
Igor Katson 2023-12-03 09:43:46 +00:00
parent 1947da3f26
commit 63a21a50fd
No known key found for this signature in database
GPG key ID: B4EC22B66D61A3F5
4 changed files with 4 additions and 4 deletions

View file

@ -30,7 +30,7 @@ const makeRequest = async (method: string, path: string, data?: any): Promise<an
} }
error.status = response.status; error.status = response.status;
error.statusText = response.statusText; error.statusText = `${response.status} ${response.statusText}`;
if (!response.ok) { if (!response.ok) {
const errorBody = await response.text(); const errorBody = await response.text();

View file

@ -398,7 +398,7 @@ const ErrorDetails = (props: { details: ApiErrorDetails | null | undefined }) =>
return null; return null;
} }
return <> return <>
<p>{details.status && <strong>{details.status} {details.statusText}</strong>}</p> {details.statusText && <p><strong>{details.statusText}</strong></p>}
<pre>{details.text}</pre> <pre>{details.text}</pre>
</> </>

View file

@ -1,7 +1,7 @@
[package] [package]
name = "rqbit-desktop" name = "rqbit-desktop"
version = "0.0.0" version = "0.0.0"
description = "A Tauri App" description = "rqbit torrent client"
authors = ["you"] authors = ["you"]
license = "" license = ""
repository = "" repository = ""

View file

@ -37,7 +37,7 @@
"fullscreen": false, "fullscreen": false,
"resizable": true, "resizable": true,
"title": "rqbit", "title": "rqbit",
"width": 800, "width": 992,
"height": 600 "height": 600
} }
] ]