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

Mahdiyeh/ Fix: rerendering the TradingPasswordModal component #5286

Merged
merged 4 commits into from
Apr 21, 2022

Conversation

mahdiyeh-deriv
Copy link
Contributor

Changes:

Please include a summary of the change and which issue is fixed below:

  • Fix infinite re-rendering TradingPasswordModal component

When you need to add unit test

  • If this change disrupt current flow
  • If this change is adding new flow

When you need to add integration test

  • If components from external libraries are being used to define the flow, e.g. @deriv/components
  • If it relies on a very specific set of props with no default behavior for the current component.

Test coverage checklist (for reviewer)

  • Ensure utility / function has a test case
  • Ensure all the tests are passing

Type of change

  • Bug fix
  • New feature
  • Update feature
  • Refactor code
  • Translation to code
  • Translation to crowdin
  • Script configuration
  • Improve performance
  • Style only
  • Dependency update
  • Documentation update
  • Release

@vercel
Copy link

vercel bot commented Apr 20, 2022

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

Name Status Preview Updated
deriv-app ✅ Ready (Inspect) Visit Preview Apr 21, 2022 at 2:40AM (UTC)

@@ -206,7 +206,7 @@ const ResetTradingPasswordModal = ({
const [dialog_title, setDialogTitle] = React.useState('');
const history = useHistory();
React.useEffect(() => {
if (is_visible) {
if (is_visible && history.location.search !== '') {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

replacing the history resulted in rerendering the component , adding the condition prevent the unnecessary re-rendering

matin-deriv
matin-deriv previously approved these changes Apr 20, 2022
@codecov-commenter
Copy link

codecov-commenter commented Apr 20, 2022

Codecov Report

Merging #5286 (09634e9) into master (fbdbd08) will decrease coverage by 0.00%.
The diff coverage is 0.00%.

@@            Coverage Diff             @@
##           master    #5286      +/-   ##
==========================================
- Coverage   13.33%   13.33%   -0.01%     
==========================================
  Files        1282     1282              
  Lines       29019    29020       +1     
  Branches     4894     4895       +1     
==========================================
  Hits         3870     3870              
- Misses      24911    24912       +1     
  Partials      238      238              
Impacted Files Coverage Δ
...ng-password-modal/reset-trading-password-modal.jsx 0.00% <0.00%> (ø)
...es/cfd/src/Containers/cfd-reset-password-modal.tsx 0.00% <0.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update fbdbd08...09634e9. Read the comment docs.

@matin-deriv matin-deriv merged commit 1a9f9ca into deriv-com:master Apr 21, 2022
@sonarcloud
Copy link

sonarcloud bot commented Apr 21, 2022

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
2.8% 2.8% Duplication

@github-actions
Copy link
Contributor

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/5286](https://github.com/binary-com/deriv-app/pull/5286)
- **URLs**:
    - **w/ App ID + Server**: https://deriv-app-git-fork-mahdiyeh-fs-hotfixtradingpassword.binary.sx?qa_server=frontend.binaryws.com&app_id=24219
    - **Original**: https://deriv-app-git-fork-mahdiyeh-fs-hotfixtradingpassword.binary.sx
- **App ID**: `24219`

sandeep-deriv pushed a commit to sandeep-deriv/deriv-app that referenced this pull request Apr 29, 2022
…com#5286)

* fix rerendering the TradingPasswordModal component

* fix reopening the invester password

Co-authored-by: Matin shafiei <matin@deriv.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants