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:
parent
d339bebca0
commit
f7eba319b5
1 changed files with 11 additions and 9 deletions
|
|
@ -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();
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue