Skip to content

Commit

Permalink
fix: reduce cognitive complexity
Browse files Browse the repository at this point in the history
  • Loading branch information
shafin-deriv committed Sep 4, 2023
1 parent e743e5e commit e55bec4
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ const FAQContent = observer(({ faq_list, hide_header = false }: TFAQContent) =>
const open_accordion_element: HTMLElement | null | undefined =
faq_wrapper_element.current?.querySelector('.dc-accordion__item--open');
const previous_sibling_element = open_accordion_element?.previousElementSibling as HTMLElement;
if (faq_wrapper_element?.current && open_accordion_element) {
if (faq_wrapper_element.current && open_accordion_element) {
const offset = previous_sibling_element ? previous_sibling_element.offsetTop - 80 : 0;
scrollToElement(faq_wrapper_element?.current, offset);
}
Expand Down

0 comments on commit e55bec4

Please sign in to comment.