1
0
mirror of https://github.com/Radarr/Radarr.git synced 2026-04-24 22:35:49 -04:00

Translate Frontend Components and Helpers

(cherry picked from commit e777b7018481b18ef18f1116f75983a037bf0849)

Closes #8995
This commit is contained in:
Stevie Robinson
2023-08-13 23:04:18 +02:00
committed by Bogdan
parent 22ec1fe492
commit 02baf4d7a4
60 changed files with 621 additions and 482 deletions
@@ -1,11 +0,0 @@
function getErrorMessage(xhr, fallbackErrorMessage) {
if (!xhr || !xhr.responseJSON || !xhr.responseJSON.message) {
return fallbackErrorMessage;
}
const message = xhr.responseJSON.message;
return message || fallbackErrorMessage;
}
export default getErrorMessage;
@@ -0,0 +1,15 @@
import { Error } from 'App/State/AppSectionState';
function getErrorMessage(xhr: Error, fallbackErrorMessage?: string) {
if (!xhr || !xhr.responseJSON) {
return fallbackErrorMessage;
}
if ('message' in xhr.responseJSON && xhr.responseJSON.message) {
return xhr.responseJSON.message;
}
return fallbackErrorMessage;
}
export default getErrorMessage;