From 04ae9801ff6ca2ca0d1bf894b7f1d90cf284fead Mon Sep 17 00:00:00 2001 From: Maxwell Lin <28914712+maxwellmlin@users.noreply.github.com> Date: Sat, 21 Oct 2023 11:38:30 -0400 Subject: [PATCH] Bug fix --- .../call-service-panel/src/CallServicePanel.tsx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/foxglove/extensions/call-service-panel/src/CallServicePanel.tsx b/foxglove/extensions/call-service-panel/src/CallServicePanel.tsx index 3f86548e9..352e070bd 100644 --- a/foxglove/extensions/call-service-panel/src/CallServicePanel.tsx +++ b/foxglove/extensions/call-service-panel/src/CallServicePanel.tsx @@ -30,13 +30,13 @@ function CallServicePanel({ context }: { context: PanelExtensionContext }): JSX. }, [renderDone]); const callService = useCallback( - (serviceName: string, request: string) => { + async (serviceName: string, request: string) => { if (!context.callService) { return; } try { - const response = context.callService(serviceName, JSON.parse(request)); + const response = await context.callService(serviceName, JSON.parse(request)); JSON.stringify(response); // Attempt serializing the response, to throw an error on failure setState((oldState) => ({ ...oldState, @@ -86,8 +86,8 @@ function CallServicePanel({ context }: { context: PanelExtensionContext }): JSX.