mirror of
https://github.com/lidarr/lidarr.git
synced 2025-08-13 02:07:12 -07:00
Fixed: Ensure translations are fetched before loading app
(cherry picked from commit ad2721dc55f3233e4c299babe5744418bc530418) Closes #3880
This commit is contained in:
parent
60e71380e4
commit
6424d2b045
6 changed files with 42 additions and 20 deletions
|
@ -7,6 +7,7 @@ function ErrorPage(props) {
|
|||
const {
|
||||
version,
|
||||
isLocalStorageSupported,
|
||||
hasTranslationsError,
|
||||
artistError,
|
||||
customFiltersError,
|
||||
tagsError,
|
||||
|
@ -20,6 +21,8 @@ function ErrorPage(props) {
|
|||
|
||||
if (!isLocalStorageSupported) {
|
||||
errorMessage = 'Local Storage is not supported or disabled. A plugin or private browsing may have disabled it.';
|
||||
} else if (hasTranslationsError) {
|
||||
errorMessage = 'Failed to load translations from API';
|
||||
} else if (artistError) {
|
||||
errorMessage = getErrorMessage(artistError, 'Failed to load artist from API');
|
||||
} else if (customFiltersError) {
|
||||
|
@ -52,6 +55,7 @@ function ErrorPage(props) {
|
|||
ErrorPage.propTypes = {
|
||||
version: PropTypes.string.isRequired,
|
||||
isLocalStorageSupported: PropTypes.bool.isRequired,
|
||||
hasTranslationsError: PropTypes.bool.isRequired,
|
||||
artistError: PropTypes.object,
|
||||
customFiltersError: PropTypes.object,
|
||||
tagsError: PropTypes.object,
|
||||
|
|
|
@ -220,6 +220,7 @@ class PageConnector extends Component {
|
|||
|
||||
render() {
|
||||
const {
|
||||
hasTranslationsError,
|
||||
isPopulated,
|
||||
hasError,
|
||||
dispatchFetchArtist,
|
||||
|
@ -233,11 +234,12 @@ class PageConnector extends Component {
|
|||
...otherProps
|
||||
} = this.props;
|
||||
|
||||
if (hasError || !this.state.isLocalStorageSupported) {
|
||||
if (hasTranslationsError || hasError || !this.state.isLocalStorageSupported) {
|
||||
return (
|
||||
<ErrorPage
|
||||
{...this.state}
|
||||
{...otherProps}
|
||||
hasTranslationsError={hasTranslationsError}
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
@ -258,6 +260,7 @@ class PageConnector extends Component {
|
|||
}
|
||||
|
||||
PageConnector.propTypes = {
|
||||
hasTranslationsError: PropTypes.bool.isRequired,
|
||||
isPopulated: PropTypes.bool.isRequired,
|
||||
hasError: PropTypes.bool.isRequired,
|
||||
isSidebarVisible: PropTypes.bool.isRequired,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue