Skip to content

Commit

Permalink
Minor code cleanup, changelog update
Browse files Browse the repository at this point in the history
  • Loading branch information
lukeromanowicz authored and Lukasz Romanowicz committed Sep 13, 2019
1 parent 5d0775e commit dfcd668
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Fixed warning in product details because of duplicate `product` property in `AddToCompare` mixin - @cewald (#3428)
- Fixed "Clear Wishlist" Button - @dz3n (#3522)
- Fixed hash in dynamically resolved urls causing resolving issues - @lukeromanowicz (#3515)
- Fix invalid routes in ButtonOutline - @lukeromanowicz
- Fix invalid routes in ButtonOutline - @lukeromanowicz (#3541)

### Changed / Improved

Expand Down
18 changes: 9 additions & 9 deletions core/lib/multistore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -233,18 +233,18 @@ export function localizedRoute (routeObj: LocalizedRoute | string | RouteConfig
return localizedDispatcherRoute(Object.assign({}, routeObj) as LocalizedRoute, storeCode)
}
}
if (storeCode && routeObj && config.defaultStoreCode !== storeCode && config.storeViews[storeCode].appendStoreCode) {
if (typeof routeObj === 'object') {
if (routeObj.name) {
routeObj.name = storeCode + '-' + routeObj.name
}

if (routeObj.path) {
routeObj.path = '/' + storeCode + '/' + (routeObj.path.startsWith('/') ? routeObj.path.slice(1) : routeObj.path)
}
} else {
if (storeCode && config.defaultStoreCode !== storeCode && config.storeViews[storeCode].appendStoreCode) {
if (typeof routeObj !== 'object') {
return '/' + storeCode + routeObj
}
if (routeObj.name) {
routeObj.name = storeCode + '-' + routeObj.name
}

if (routeObj.path) {
routeObj.path = '/' + storeCode + '/' + (routeObj.path.startsWith('/') ? routeObj.path.slice(1) : routeObj.path)
}
}

return routeObj
Expand Down

0 comments on commit dfcd668

Please sign in to comment.