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

likhith/fix: 🐛 strike price dropdown is empty for day duration change #23

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/shared/src/utils/shortcode/shortcode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export const extractInfoFromShortcode = (shortcode: string) => {
};

const is_multipliers = /^MULT/i.test(shortcode);
const is_vanilla = /^VANILLA/i.test(shortcode);

// First group of regex pattern captures the trade category, second group captures the market's underlying
const pattern = is_multipliers ? multipliers_regex : options_regex;
const extracted = pattern.exec(shortcode);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@ const Strike = ({
const [should_open_dropdown, setShouldOpenDropdown] = React.useState(false);
const [selected_value, setSelectedValue] = React.useState(barrier_1);

React.useEffect(() => {
setSelectedValue(barrier_1);
}, [barrier_1]);

const toggleWidget = () => setIsOpen(!is_open);

const is_24_hours_contract = expiry_date ? toMoment(expiry_date).isSame(toMoment(server_time), 'day') : false;
Expand Down