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

henry/dtra-1563/fix: asset/symbol selection bug fix #16333

Conversation

henry-deriv
Copy link
Contributor

Changes:

Please provide a summary of the change.

Screenshots:

Please provide some screenshots of the change.

Copy link

vercel bot commented Aug 2, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
deriv-app ✅ Ready (Inspect) Visit Preview Aug 14, 2024 8:30am

@henry-deriv henry-deriv changed the title henry/dtra-1563/fix: make market-category-item clickable area bigger henry/dtra-1563/fix: asset/symbol selection bug fix Aug 2, 2024
Copy link
Contributor

github-actions bot commented Aug 2, 2024

A production App ID was automatically generated for this PR. (log)

Click here to copy & paste above information.
- **PR**: [https://github.com/binary-com/deriv-app/pull/16333](https://github.com/binary-com/deriv-app/pull/16333)
- **URLs**:
    - **w/ App ID + Server**: https://deriv-app-git-fork-henry-deriv-henry-dtra-1563dtra-v2-sy-0a7a03.binary.sx?qa_server=red.derivws.com&app_id=32227
    - **Original**: https://deriv-app-git-fork-henry-deriv-henry-dtra-1563dtra-v2-sy-0a7a03.binary.sx
- **App ID**: `32227`

Copy link
Contributor

github-actions bot commented Aug 2, 2024

🚨 Lighthouse report for the changes in this PR:

Category Score
🔺 Performance 27
🟧 Accessibility 70
🟧 Best practices 83
🟧 SEO 77
🟧 PWA 78

Lighthouse ran with https://deriv-app-git-fork-henry-deriv-henry-dtra-1563dtra-v2-sy-0a7a03.binary.sx/

@coveralls
Copy link

coveralls commented Aug 2, 2024

Coverage Status

coverage: 46.908% (+0.04%) from 46.865%
when pulling 140a3d6 on henry-deriv:henry/dtra-1563/dtra-v2-symbol-selector-fix
into 6af2bc1 on binary-com:master.

maryia-deriv
maryia-deriv previously approved these changes Aug 7, 2024
@@ -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;
Copy link
Contributor

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?

Copy link
Contributor Author

@henry-deriv henry-deriv Aug 14, 2024

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.

Copy link
Contributor Author

@henry-deriv henry-deriv Aug 14, 2024

Choose a reason for hiding this comment

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

slightly messy

Copy link
Contributor Author

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.

Copy link
Contributor

Choose a reason for hiding this comment

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

Okay-okay, no problem)

maryia-deriv
maryia-deriv previously approved these changes Aug 14, 2024
Copy link

sonarcloud bot commented Aug 14, 2024

@vinu-deriv vinu-deriv merged commit df7f2a8 into binary-com:master Aug 15, 2024
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants