Skip to content

Commit

Permalink
refactor: 1 more timer cleanup and more nit-picks
Browse files Browse the repository at this point in the history
  • Loading branch information
maryia-deriv committed Aug 8, 2024
1 parent eb9d275 commit d27e162
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion scripts/common.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ exports.sections_config = {
'': { // '' is the default section when no 'section' specified in pages.js (to avoid adding 'app' as section for all)
path : '',
js_files : ['vendor', 'binary'],
css_files: ['common.min', 'app.min', 'static.min','reset.min'],
css_files: ['common.min', 'app.min', 'static.min', 'reset.min'],
has_pjax : true,
},
};
Expand Down
6 changes: 2 additions & 4 deletions src/javascript/app/pages/bottom/tabs.jsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { useEffect, useState } from 'react';
import React, { useEffect, useRef, useState } from 'react';
import ReactDOM from 'react-dom';
import { SegmentedControlSingleChoice } from '@deriv-com/quill-ui';
import { Explanation } from './explanation.jsx';
Expand Down Expand Up @@ -75,9 +75,7 @@ const BottomTabs = () => {
}, 100);
}, [selectedTab, savedTab]);

useEffect(() => {
return () => clearTimeout(triggerOldTabTimer.current);
}, []);
useEffect(() => () => clearTimeout(triggerOldTabTimer.current), []);

return (
<>
Expand Down
6 changes: 4 additions & 2 deletions src/javascript/app/pages/trade/markets/contracts-dropdown.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ export const ContractDropdown = () => {
const [data, setData] = useState(dataManager.getAllContracts());
const selectedRef = useRef(null);
const containerRef = useRef(null);
const closeDropdownTimer = useRef();

const onContractClick = (formName) => {
if (formName === data?.formName) { return; }
Expand All @@ -30,12 +31,13 @@ export const ContractDropdown = () => {

triggerContractChange();

setTimeout(() => {
closeDropdownTimer.current = setTimeout(() => {
close();
}, 10);

};

useEffect(() => () => clearTimeout(closeDropdownTimer.current), []);

useEffect(() => {
setData(oldData => ({
...oldData,
Expand Down
2 changes: 1 addition & 1 deletion src/sass/_common/components.scss
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
}
}

.highcharts-container {
.highcharts-container {
.highcharts-subtitle {
white-space: normal !important;

Expand Down

0 comments on commit d27e162

Please sign in to comment.