-
Notifications
You must be signed in to change notification settings - Fork 298
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
henry/dtra-1563/fix: asset/symbol selection bug fix #16333
henry/dtra-1563/fix: asset/symbol selection bug fix #16333
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
A production App ID was automatically generated for this PR. (log)
Click here to copy & paste above information.
|
🚨 Lighthouse report for the changes in this PR:
Lighthouse ran with https://deriv-app-git-fork-henry-deriv-henry-dtra-1563dtra-v2-sy-0a7a03.binary.sx/ |
@@ -1282,6 +1286,16 @@ export default class TradeStore extends BaseStore { | |||
} | |||
} | |||
|
|||
get is_dtrader_v2_enabled() { | |||
const is_dtrader_v2 = JSON.parse(localStorage.getItem('FeatureFlagsStore') ?? '').data.dtrader_v2; |
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.
We have isDTraderV2 function in shared. It checked localstorage and innerWidth. Can it be reused? Or modified?
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.
im seeing instances where pathnames are checked individually
isDTraderV2() && !is_contract_details
OR
if (isDTraderV2())
return (
<Loading.DTraderV2
initial_app_loading
is_contract_details={location.pathname.startsWith('/contract/')}
is_positions={location.pathname === routes.trader_positions}
is_closed_tab={getPositionsV2TabIndexFromURL() === 1}
/>
);
if (is_positions)
return <PositionsLoader initial_app_loading={initial_app_loading} is_closed_tab={is_closed_tab} />;
if (is_contract_details) return <ContractDetailsLoader />;
so if i am to use the the shared function then
where i use this.is_dtrader_v2_enabled
it'll be replaced with
isDtraderV2() && (window.location.pathname.startsWith(routes.trade) || window.location.pathname.startsWith('/contract/'))
in two separate places.
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.
slightly messy
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.
at some point we'll likely need some kind of cleanup since this kind of logic with many variations is used in many places.
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.
Okay-okay, no problem)
Quality Gate passedIssues Measures |
Changes:
Please provide a summary of the change.
Screenshots:
Please provide some screenshots of the change.