-
Notifications
You must be signed in to change notification settings - Fork 58
Fix open parenthesis on user saved trips #1479
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice fix
return string.split(',')[0] | ||
let newString = string.split(',')[0] | ||
// If there is an open parenthesis without a close (user saved place), add one. | ||
if (newString.includes('(') && !newString.includes(')')) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What about this string? Coffee (Starbucks (Market & 20th)
? I think you may need to actually count the open and close parentheses 🙃 I knew this leetcode problem would come in handy one day!!
Revised the approach! Much easier than I expected it to be, although slightly different than what we discussed on our call. Reassigning @binh-dam-ibigroup to re-review |
} | ||
function findCustomLocationShortName(location, locations = []) { | ||
const match = locations.find((l) => matchLatLon(l, location)) | ||
return match && (match.type === 'custom' || match.type === 'dining') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: Try excluding "Home" and "Work" instead?
Description:
Fixes a bug where user saved trips, which are formatted
nickname (placename)
were not showing the close parenthesis in the previous trips pane.Open to another approach or laying out the user places in a different way. Are there cases where there could be a "(" character in a name that does not require a close parenthesis?
PR Checklist: