Skip to content
This repository has been archived by the owner on Oct 6, 2022. It is now read-only.

Check for lightdm in window and if languages is an object #5

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

cytodev
Copy link

@cytodev cytodev commented Mar 1, 2017

Addresses issue #2

src/index.js Outdated
@@ -8,7 +8,7 @@ import injectTapEventPlugin from 'react-tap-event-plugin';
injectTapEventPlugin();

// Load mock if in development mode
if (!lightdm && process.env.NODE_ENV === 'development') {
if (!(lightdm in window) && process.env.NODE_ENV === 'development') {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lightdm should be a string here. !("lightdm" in window)

src/index.js Outdated
@@ -46,15 +46,15 @@ if (!lightdm && process.env.NODE_ENV === 'development') {
}
}

if (!lightdm || !lightdm.languages) {
if (!(lightdm in window) || !(typeof lightdm.languages === "object")) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same here

src/index.js Outdated
const timeout = setTimeout(() => {
clearInterval(interval);
document.body.innerHTML += '<h1 style="background-color: white; color: red;">Lightdm did not load</h1>';
throw new Error('lightdm did not load in time');
}, 1000);
const interval = setInterval(() => {

if (lightdm && lightdm.languages) {
if (lightdm in window && typeof lightdm.languages === "object") {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

and here

Thanks francoiscote
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants