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

fix invalid route in ButtonOutline #3541

Conversation

lukeromanowicz
Copy link
Contributor

Related issues

followup to #3515

@lukeromanowicz lukeromanowicz force-pushed the bugfix/invalid-route-in-buttonoutline branch from bb792c9 to dfcd668 Compare September 13, 2019 09:00
Copy link
Collaborator

@patzick patzick left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

config.storeViews reaching is potentially dangerous. Someone could just type random language in url and it would fail

routeObj.path = '/' + storeCode + '/' + (routeObj.path.startsWith('/') ? routeObj.path.slice(1) : routeObj.path)
}
} else {
if (storeCode && config.defaultStoreCode !== storeCode && config.storeViews[storeCode].appendStoreCode) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what if somehow config.storeViews[storeCode] would not exist?

@@ -1,7 +1,7 @@
<template>
<component
:is="link ? 'router-link' : 'button'"
:to="localizedRoute(link)"
:to="link ? localizedRoute(link) : null"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i believe we shouldn't direct on users such logic; we're returning here the same object, it's not necessary and overcomplication for newcomers.

@patzick patzick merged commit 4a4f306 into vuestorefront:develop Sep 13, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants