Fixing eslint errors and warnings under /app/javascript/packs (#4465)

Changes:
 - Refactored articleForm.jsx by moving loadForm() before document.ready.then()
 - Removed 'function' in .then() and modified to .then(() => {
 - Removed unused function 'isUserSignedIn' in Onboarding.jsx

See: #2470
This commit is contained in:
Eddie Hale 2019-10-17 08:29:40 -05:00 committed by Ben Halpern
parent d339bebca0
commit f7eba319b5

View file

@ -10,15 +10,6 @@ HTMLDocument.prototype.ready = new Promise(resolve => {
return null;
});
document.ready.then(function() {
loadForm();
window.InstantClick.on('change', () => {
if (document.getElementById('article-form')) {
loadForm();
}
});
});
function loadForm() {
getUserDataAndCsrfToken().then(({ currentUser, csrfToken }) => {
window.currentUser = currentUser;
@ -38,3 +29,14 @@ function loadForm() {
);
});
}
document.ready.then(() => {
loadForm();
window.InstantClick.on('change', () => {
if (document.getElementById('article-form')) {
loadForm();
}
});
});