diff --git a/app/initializers/defer-loading.js b/app/initializers/defer-loading.js new file mode 100644 index 0000000..c6e8c28 --- /dev/null +++ b/app/initializers/defer-loading.js @@ -0,0 +1,15 @@ +/** + * This pauses the app's boot process until the window load event is fired. + * It allows the user provided Web3 instance (e.g. Metamask, Mist Browser) + * to be inserted before we try to use it. + */ +export default { + name: 'defer-loading', + initialize: function(application) { + application.deferReadiness(); + + window.addEventListener('load', function() { + application.advanceReadiness(); + }); + } +};