Wait for usw-ready
before sending style
This commit is contained in:
parent
b1d7e4caf3
commit
62791cda82
|
@ -16,14 +16,15 @@
|
||||||
&& allowedOrigin === event.origin
|
&& allowedOrigin === event.origin
|
||||||
) {
|
) {
|
||||||
sendPostMessage({type: 'usw-remove-stylus-button'});
|
sendPostMessage({type: 'usw-remove-stylus-button'});
|
||||||
|
|
||||||
|
if (window.location.pathname === '/api/oauth/authorize_style/new') {
|
||||||
|
API.styles.find({_linking: true}).then(style => {
|
||||||
|
console.log(style);
|
||||||
|
sendPostMessage({type: 'usw-fill-new-style', data: style});
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
if (window.location.pathname === '/api/oauth/authorize_style/new') {
|
|
||||||
API.styles.find({_linking: true}).then(style => {
|
|
||||||
sendPostMessage({type: 'usw-fill-new-style', data: style});
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
window.addEventListener('message', onPageLoaded);
|
window.addEventListener('message', onPageLoaded);
|
||||||
})();
|
})();
|
||||||
|
|
Loading…
Reference in New Issue
Block a user