Skip to content

Commit

Permalink
Gallery: Fix React Comiler reassignment error (#66408)
Browse files Browse the repository at this point in the history
Co-authored-by: Mamaduka <[email protected]>
Co-authored-by: tyxla <[email protected]>
  • Loading branch information
3 people authored Oct 24, 2024
1 parent 9c7847d commit 87ab311
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions packages/block-library/src/gallery/edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ import useGetMedia from './use-get-media';
import GapStyles from './gap-styles';

const MAX_COLUMNS = 8;
let linkOptions = [
const LINK_OPTIONS = [
{
icon: customLink,
label: __( 'Link images to attachment pages' ),
Expand Down Expand Up @@ -117,13 +117,13 @@ export default function GalleryEdit( props ) {
onFocus,
} = props;

const lightboxSetting = useSettings( 'blocks.core/image.lightbox' )[ 0 ];
const [ lightboxSetting ] = useSettings( 'blocks.core/image.lightbox' );

if ( ! lightboxSetting?.allowEditing ) {
linkOptions = linkOptions.filter(
( option ) => option.value !== LINK_DESTINATION_LIGHTBOX
);
}
const linkOptions = ! lightboxSetting?.allowEditing
? LINK_OPTIONS.filter(
( option ) => option.value !== LINK_DESTINATION_LIGHTBOX
)
: LINK_OPTIONS;

const { columns, imageCrop, randomOrder, linkTarget, linkTo, sizeSlug } =
attributes;
Expand Down

1 comment on commit 87ab311

@github-actions
Copy link

Choose a reason for hiding this comment

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

Flaky tests detected in 87ab311.
Some tests passed with failed attempts. The failures may not be related to this commit but are still reported for visibility. See the documentation for more information.

🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/11498835534
📝 Reported issues:

Please sign in to comment.