Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Register store which is imported instead of required #2837

Merged
merged 1 commit into from
Jan 13, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion src/phoenix.js
Original file line number Diff line number Diff line change
Expand Up @@ -128,9 +128,11 @@ function loadApps () {
}
})
}

if (app.store) {
store.registerModule(app.appInfo.name, app.store.default)
registerStoreModule(app)
}

store.dispatch('registerApp', app.appInfo)
if (config.external_apps) {
store.dispatch('loadExternalAppConfig', { app: app.appInfo, config })
Expand Down Expand Up @@ -176,6 +178,14 @@ function loadApps () {
})
}

function registerStoreModule (app) {
if (app.store.default) {
return store.registerModule(app.appInfo.name, app.store.default)
}

return store.registerModule(app.appInfo.name, app.store)
}

function missingConfig () {
const translations = coreTranslations

Expand Down