Skip to content
This repository has been archived by the owner on Feb 23, 2024. It is now read-only.

Commit

Permalink
improve code style
Browse files Browse the repository at this point in the history
  • Loading branch information
gigitux committed Oct 11, 2023
1 parent 69daeae commit 8fe7233
Showing 1 changed file with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -94,11 +94,14 @@ interactivityStore(
effects: {
woocommerce: {
scrollInto: ( store: Store ) => {
if ( ! store.selectors.woocommerce.isSelected( store ) ) {
return;
}

// Scroll to the selected image with a smooth animation.
if (
store.selectors?.woocommerce?.isSelected( store ) &&
store.context.woocommerce.isDialogOpen ===
isDialogStatusChanged
isDialogStatusChanged
) {
store.ref.scrollIntoView( {
behavior: 'smooth',
Expand All @@ -112,7 +115,6 @@ interactivityStore(
store.context.woocommerce.isDialogOpen &&
store.context.woocommerce.isDialogOpen !==
isDialogStatusChanged &&
store.selectors?.woocommerce?.isSelected( store ) &&
store.ref.tagName === 'IMG' &&
store.ref.closest( 'dialog' )
) {
Expand All @@ -131,7 +133,6 @@ interactivityStore(
! store.context.woocommerce.isDialogOpen &&
store.context.woocommerce.isDialogOpen !==
isDialogStatusChanged &&
store.selectors?.woocommerce?.isSelected( store ) &&
store.ref.tagName === 'IMG'
) {
store.ref.scrollIntoView( {
Expand Down

0 comments on commit 8fe7233

Please sign in to comment.