From 638f4d12a6c9e514b7c73383c6f20b1f6a34aed1 Mon Sep 17 00:00:00 2001 From: mikebender Date: Fri, 8 Dec 2023 12:55:15 -0500 Subject: [PATCH] Pass the `false` flag for takeOwnership - Based on latest review cleanup --- plugins/ui/src/js/src/WidgetHandler.tsx | 2 +- plugins/ui/src/js/src/WidgetTypes.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/ui/src/js/src/WidgetHandler.tsx b/plugins/ui/src/js/src/WidgetHandler.tsx index 3d00b9442..cb2283dd4 100644 --- a/plugins/ui/src/js/src/WidgetHandler.tsx +++ b/plugins/ui/src/js/src/WidgetHandler.tsx @@ -194,7 +194,7 @@ function WidgetHandler({ onClose, widget: wrapper }: WidgetHandlerProps) { log.debug('loadWidget', wrapper.id, wrapper.definition); let isCancelled = false; async function loadWidgetInternal() { - const newWidget = await wrapper.fetch(); + const newWidget = await wrapper.fetch(false); if (isCancelled) { newWidget.close(); return; diff --git a/plugins/ui/src/js/src/WidgetTypes.ts b/plugins/ui/src/js/src/WidgetTypes.ts index f0ca0ca3c..c4ed147a3 100644 --- a/plugins/ui/src/js/src/WidgetTypes.ts +++ b/plugins/ui/src/js/src/WidgetTypes.ts @@ -9,7 +9,7 @@ export interface WidgetMessageDetails { export type WidgetMessageEvent = CustomEvent; -export type WidgetFetch = () => Promise; +export type WidgetFetch = (takeOwnership?: boolean) => Promise; export type WidgetWrapper = { definition: WidgetDefinition;