mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-11-25 19:48:50 +03:00
Fixed eslint no-console error
no issue - Throws error on signout failure instead of console log - Disables eslint for data initialization failure to allow logging error to console
This commit is contained in:
parent
982c9d19ef
commit
4b01a1eac9
@ -32,7 +32,9 @@ export default class ParentContainer extends React.Component {
|
||||
this.GhostApi = setupGhostApi({adminUrl});
|
||||
this.fetchData();
|
||||
} else {
|
||||
/* eslint-disable no-console */
|
||||
console.error(`[Members.js] Failed to initialize, pass a valid admin url.`);
|
||||
/* eslint-enable no-console */
|
||||
this.setState({
|
||||
action: 'init:failed:missingAdminUrl'
|
||||
});
|
||||
@ -53,7 +55,9 @@ export default class ParentContainer extends React.Component {
|
||||
initStatus: 'success'
|
||||
});
|
||||
} catch (e) {
|
||||
/* eslint-disable no-console */
|
||||
console.error(`[Members.js] Failed to fetch site data, please make sure your admin url - ${adminUrl} - is correct.`);
|
||||
/* eslint-enable no-console */
|
||||
this.setState({
|
||||
action: 'init:failed:incorrectAdminUrl',
|
||||
initStatus: 'failed'
|
||||
|
@ -104,7 +104,7 @@ function setupGhostApi({adminUrl}) {
|
||||
window.location.reload();
|
||||
return 'Success';
|
||||
} else {
|
||||
console.log('Failed to signout!', res);
|
||||
throw new Error('Failed to signout');
|
||||
}
|
||||
});
|
||||
},
|
||||
|
Loading…
Reference in New Issue
Block a user