Merge pull request #664 from yuya-oc/fix-loading-icon

Support React 16 of webapp for loading icon
This commit is contained in:
Yuya Ochiai 2017-11-28 00:32:48 +09:00 committed by GitHub
commit 59209ae604
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -12,11 +12,14 @@ Notification = EnhancedNotification; // eslint-disable-line no-global-assign, no
Reflect.deleteProperty(global.Buffer); // http://electron.atom.io/docs/tutorial/security/#buffer-global
function isReactAppInitialized() {
const reactRoot = document.querySelector('div[data-reactroot]');
if (reactRoot === null) {
const initializedRoot =
document.querySelector('#root.channel-view') || // React 16 webapp
document.querySelector('#root .signup-team__container') || // React 16 login
document.querySelector('div[data-reactroot]'); // Older React apps
if (initializedRoot === null) {
return false;
}
return reactRoot.children.length !== 0;
return initializedRoot.children.length !== 0;
}
function watchReactAppUntilInitialized(callback) {