From 8e466befb465b537452a6d2a8161897e1359ff47 Mon Sep 17 00:00:00 2001 From: Michael Macherey Date: Wed, 11 Oct 2017 14:40:52 +0200 Subject: [PATCH 1/2] Fix Shortcuts help menu doesn't dismiss forever. --- client/coral-admin/src/index.js | 1 + client/coral-framework/services/bootstrap.js | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/client/coral-admin/src/index.js b/client/coral-admin/src/index.js index 736d3efc9..442a4f536 100644 --- a/client/coral-admin/src/index.js +++ b/client/coral-admin/src/index.js @@ -23,6 +23,7 @@ function init({store, storage}) { async function main() { const notification = createNotificationService(toast); const context = await createContext({reducers, graphqlExtension, pluginsConfig, notification, init}); + render( diff --git a/client/coral-framework/services/bootstrap.js b/client/coral-framework/services/bootstrap.js index 492f6cc40..d64b769e3 100644 --- a/client/coral-framework/services/bootstrap.js +++ b/client/coral-framework/services/bootstrap.js @@ -178,6 +178,10 @@ export async function createContext({ await preInit(context); } + if (init) { + await init(context); + } + // Run initialization. await Promise.all([init, plugins.executeInit(context)]); return context; From 2dcab1fb1248535ef34535019a652b7dd3a15f4c Mon Sep 17 00:00:00 2001 From: Michael Macherey Date: Fri, 13 Oct 2017 14:00:28 +0200 Subject: [PATCH 2/2] add noop function, handle undefined --- client/coral-framework/services/bootstrap.js | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/client/coral-framework/services/bootstrap.js b/client/coral-framework/services/bootstrap.js index d64b769e3..85144fe60 100644 --- a/client/coral-framework/services/bootstrap.js +++ b/client/coral-framework/services/bootstrap.js @@ -7,6 +7,7 @@ import {createRestClient} from './rest'; import thunk from 'redux-thunk'; import {loadTranslations} from './i18n'; import bowser from 'bowser'; +import noop from 'lodash/noop'; import {BASE_PATH} from 'coral-framework/constants/url'; import {createPluginsService} from './plugins'; import {createNotificationService} from './notification'; @@ -77,7 +78,7 @@ export async function createContext({ graphqlExtension = {}, notification, preInit, - init, + init = noop, } = {}) { const eventEmitter = new EventEmitter({wildcard: true}); const storage = createStorage(); @@ -178,11 +179,7 @@ export async function createContext({ await preInit(context); } - if (init) { - await init(context); - } - // Run initialization. - await Promise.all([init, plugins.executeInit(context)]); + await Promise.all([init(context), plugins.executeInit(context)]); return context; }