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:
@@ -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;
|
||||
Reference in New Issue
Block a user