From f7eba319b54e47e0e7b88a046a9f863a1874b4bc Mon Sep 17 00:00:00 2001 From: Eddie Hale Date: Thu, 17 Oct 2019 08:29:40 -0500 Subject: [PATCH] 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 --- app/javascript/packs/articleForm.jsx | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/app/javascript/packs/articleForm.jsx b/app/javascript/packs/articleForm.jsx index 1bac4ac64..51a488427 100644 --- a/app/javascript/packs/articleForm.jsx +++ b/app/javascript/packs/articleForm.jsx @@ -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(); + } + }); +}); + +