From 79f4e7e0f016a459db1fd2963866d9e39f66153d Mon Sep 17 00:00:00 2001 From: Chris Zarate Date: Wed, 23 Oct 2024 17:24:08 -0500 Subject: [PATCH] remoteData attribute is, in fact, optional (#177) --- .../components/field-shortcode/select-field-popover.tsx | 4 ++-- src/utils/block-binding.ts | 2 +- types/remote-data.d.ts | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/blocks/remote-data-container/components/field-shortcode/select-field-popover.tsx b/src/blocks/remote-data-container/components/field-shortcode/select-field-popover.tsx index 1a41f091..083fe1c1 100644 --- a/src/blocks/remote-data-container/components/field-shortcode/select-field-popover.tsx +++ b/src/blocks/remote-data-container/components/field-shortcode/select-field-popover.tsx @@ -43,10 +43,10 @@ export function FieldShortcodeSelectFieldPopover( props: FieldShortcodeSelectFie diff --git a/src/utils/block-binding.ts b/src/utils/block-binding.ts index e0315b47..311977b6 100644 --- a/src/utils/block-binding.ts +++ b/src/utils/block-binding.ts @@ -97,7 +97,7 @@ export function hasBlockBinding( ); } -export function hasRemoteDataChanged( one: RemoteData, two: RemoteData ): boolean { +export function hasRemoteDataChanged( one?: RemoteData, two?: RemoteData ): boolean { if ( ! one || ! two ) { return true; } diff --git a/types/remote-data.d.ts b/types/remote-data.d.ts index c8a3ceff..afb02a77 100644 --- a/types/remote-data.d.ts +++ b/types/remote-data.d.ts @@ -25,7 +25,7 @@ interface RemoteData { } interface RemoteDataBlockAttributes { - remoteData: RemoteData; + remoteData?: RemoteData; } interface FieldSelection extends RemoteDataBlockAttributes {