File tree 2 files changed +24
-3
lines changed
2 files changed +24
-3
lines changed Original file line number Diff line number Diff line change @@ -63,6 +63,7 @@ class App extends Component {
63
63
handleLogout = ( ) => this . props . store . logout ( ) ;
64
64
handleSiteURL = url => this . props . store . setSiteURL ( url ) ;
65
65
clearSiteURL = url => this . props . store . clearSiteURL ( ) ;
66
+ clearStoreError = ( ) => this . props . store . setError ( ) ;
66
67
handleExternalLogin = provider => this . props . store . externalLogin ( provider ) ;
67
68
handleUser = ( { name, email, password } ) => {
68
69
const { store } = this . props ;
@@ -201,6 +202,9 @@ class App extends Component {
201
202
onClose = { this . handleClose }
202
203
logo = { store . modal . logo }
203
204
t = { store . translate }
205
+ isLocal = { store . isLocal }
206
+ clearSiteURL = { this . clearSiteURL }
207
+ clearStoreError = { this . clearStoreError }
204
208
>
205
209
{ this . renderBody ( ) }
206
210
{ this . renderProviders ( ) }
Original file line number Diff line number Diff line change @@ -34,9 +34,13 @@ export default class Modal extends Component {
34
34
isOpen,
35
35
children,
36
36
logo,
37
- t
37
+ t,
38
+ isLocal,
39
+ clearSiteURL,
40
+ clearStoreError
38
41
} = this . props ;
39
42
const hidden = loading || ! isOpen ;
43
+ const formattedError = error ? formatError ( error ) : null ;
40
44
return (
41
45
< div
42
46
className = "modalContainer"
@@ -86,9 +90,22 @@ export default class Modal extends Component {
86
90
</ button >
87
91
</ div >
88
92
) }
89
- { error && (
93
+ { formattedError && (
90
94
< div className = "flashMessage error" >
91
- < span > { t ( formatError ( error ) ) } </ span >
95
+ < span > { t ( formattedError ) } </ span >
96
+ </ div >
97
+ ) }
98
+ { isLocal && formattedError && formattedError . includes ( 'Failed to load settings from' ) && (
99
+ < div >
100
+ < button
101
+ onclick = { e => {
102
+ clearSiteURL ( e ) ;
103
+ clearStoreError ( null ) ;
104
+ } }
105
+ className = "btnLink forgotPasswordLink"
106
+ >
107
+ { t ( "site_url_link_text" ) }
108
+ </ button >
92
109
</ div >
93
110
) }
94
111
{ children }
You can’t perform that action at this time.
0 commit comments