Skip to content

Commit

Permalink
fix: replace time and add comment (#116)
Browse files Browse the repository at this point in the history
  • Loading branch information
kate-deriv committed Mar 31, 2023
1 parent 8a44b0d commit 25c1029
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/shared/src/utils/helpers/details.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,11 +65,11 @@ export const getDurationUnitText = (obj_duration: moment.Duration, should_ignore
return days_value <= 2 ? unit_map.d.name_singular : unit_map.d.name_plural;
}
if (duration_ms >= TIME.HOUR && duration_ms < TIME.DAY) {
if (!should_ignore_end_time && isEndTime(duration_ms / (TIME.SECOND * 60 * 60))) return '';
if (!should_ignore_end_time && isEndTime(duration_ms / TIME.HOUR)) return '';
return duration_ms === TIME.HOUR ? unit_map.h.name_singular : unit_map.h.name_plural;
}
if (duration_ms >= TIME.MINUTE && duration_ms < TIME.HOUR) {
if (!should_ignore_end_time && isEndTime(duration_ms / (TIME.SECOND * 60))) return '';
if (!should_ignore_end_time && isEndTime(duration_ms / TIME.MINUTE)) return '';
return duration_ms === TIME.MINUTE ? unit_map.m.name_singular : unit_map.m.name_plural;
}
if (duration_ms >= TIME.SECOND && duration_ms < TIME.MINUTE) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ const ContractTypeWidget = ({ is_equal, name, value, list, onChange, languageCha
if (selected_item && selected_item.value !== value) {
onChange({ target: { name, value: selected_item.value } });
}
// don't include value into the dependency array, it'll breake TradeTypeTab component
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [selected_item, onChange, name]);

Expand Down

0 comments on commit 25c1029

Please sign in to comment.