Skip to content

Commit

Permalink
PAT-1721 Issue vuestorefront#3748 apply hot fix for Cannot assign to …
Browse files Browse the repository at this point in the history
…read only property 'storeCode'
  • Loading branch information
yuriboyko committed Nov 5, 2019
1 parent a996b04 commit ca1fab8
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion core/lib/multistore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,13 @@ export async function prepareStoreView (storeCode: string): Promise<StoreView> {
}
const storeViewHasChanged = !rootStore.state.storeView || rootStore.state.storeView.storeCode !== storeCode
if (storeCode) { // current store code
if ((storeView = config.storeViews[storeCode])) {
const currentStoreView = config.storeViews[storeCode]
if (currentStoreView) {
storeView = Object.assign({}, currentStoreView);
storeView.storeCode = storeCode
rootStore.state.user.current_storecode = storeCode
} else {
console.warn(`Not found 'storeView' matching the given 'storeCode': ${storeCode}`)
}
} else {
storeView.storeCode = config.defaultStoreCode || ''
Expand Down

0 comments on commit ca1fab8

Please sign in to comment.