Skip to content

Commit

Permalink
Merge pull request #989 from geoadmin/bug-PB-747-app-not-ready
Browse files Browse the repository at this point in the history
PB-747: Fix race condition in startup - #patch
  • Loading branch information
pakb authored Jul 4, 2024
2 parents 7c2c05e + 9afd766 commit 3e95337
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions src/store/plugins/app-readiness.plugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,14 @@ const appReadinessPlugin = (store) => {

if (mutation.type === 'mapModuleReady') {
store.dispatch('clearLoadingBar4MapLoading', { dispatcher })
}

// In production build we are not interested anymore in the mutation logs
// therefore unsubscribe here
if (ENVIRONMENT === 'production') {
unsubscribe()
}
// In production build we are not interested anymore in the mutation logs
// therefore unsubscribe when the app is ready and map is ready
if (state.app.isReady && state.app.isMapReady && ENVIRONMENT === 'production') {
unsubscribe()
}

// otherwise we ignore all mutations, our job is already done
})

Expand Down

0 comments on commit 3e95337

Please sign in to comment.