From 39073eba4b677c6fe986126ea272a22bf0b73ad4 Mon Sep 17 00:00:00 2001 From: Juraj Kapsz Date: Sat, 13 Apr 2024 07:50:20 +0200 Subject: [PATCH 1/2] fix picture fallback check --- .changeset/modern-mugs-raise.md | 5 +++++ packages/astro/components/Picture.astro | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) create mode 100644 .changeset/modern-mugs-raise.md diff --git a/.changeset/modern-mugs-raise.md b/.changeset/modern-mugs-raise.md new file mode 100644 index 000000000000..8b0db4895b3b --- /dev/null +++ b/.changeset/modern-mugs-raise.md @@ -0,0 +1,5 @@ +--- +"astro": patch +--- + +Fix Picture component specialFormatsFallback fallback check diff --git a/packages/astro/components/Picture.astro b/packages/astro/components/Picture.astro index f23ab6ccce7a..6dcc50c8e1d6 100644 --- a/packages/astro/components/Picture.astro +++ b/packages/astro/components/Picture.astro @@ -45,7 +45,7 @@ let resultFallbackFormat = fallbackFormat ?? defaultFallbackFormat; if ( !fallbackFormat && isESMImportedImage(originalSrc) && - originalSrc.format in specialFormatsFallback + (specialFormatsFallback as ReadonlyArray).includes(originalSrc.format) ) { resultFallbackFormat = originalSrc.format; } From c3bf432fac967b3fe06cb86c9e54423d26a152ff Mon Sep 17 00:00:00 2001 From: Bjorn Lu Date: Mon, 15 Apr 2024 16:52:14 +0800 Subject: [PATCH 2/2] Apply suggestions from code review --- .changeset/modern-mugs-raise.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.changeset/modern-mugs-raise.md b/.changeset/modern-mugs-raise.md index 8b0db4895b3b..0796acf9f8eb 100644 --- a/.changeset/modern-mugs-raise.md +++ b/.changeset/modern-mugs-raise.md @@ -2,4 +2,4 @@ "astro": patch --- -Fix Picture component specialFormatsFallback fallback check +Fixes Picture component specialFormatsFallback fallback check