* Update email subjects split test * Create alternate editor * Add proof of concept to emails * Add utm for internal nav * Add ability to boost in DEV Digest * Adjust articles.scss * Adjust article_form.scss * Remove unnecessary files * Remove files from PR * Adjust boosted email settings * Conditionally include organization in additional box * Modify schema.rb
33 lines
891 B
JavaScript
33 lines
891 B
JavaScript
import { h, render } from 'preact';
|
|
import Onboarding from '../src/Onboarding';
|
|
import { getUserData } from '../src/utils/getUserData';
|
|
|
|
HTMLDocument.prototype.ready = new Promise(resolve => {
|
|
if (document.readyState !== 'loading') {
|
|
return resolve();
|
|
}
|
|
document.addEventListener('DOMContentLoaded', () => resolve());
|
|
});
|
|
|
|
function shouldShowOnboarding() {
|
|
return (
|
|
document.head.getElementsByTagName('meta')[2].content === 'true' &&
|
|
document.body.getAttribute('data-user') &&
|
|
document.body.getAttribute('data-user') !== 'undefined' &&
|
|
JSON.parse(document.body.getAttribute('data-user')).saw_onboarding === false
|
|
);
|
|
}
|
|
|
|
function renderPage() {
|
|
if (shouldShowOnboarding()) {
|
|
setTimeout(() => {
|
|
render(<Onboarding />, document.getElementById('top-bar'));
|
|
}, 500);
|
|
}
|
|
}
|
|
|
|
document.ready.then(
|
|
getUserData().then(() => {
|
|
renderPage();
|
|
}),
|
|
);
|