From e4277a229b9185f5ac20d336e3447d00bc49d117 Mon Sep 17 00:00:00 2001 From: Ladd Hoffman Date: Thu, 25 Apr 2024 18:47:38 -0500 Subject: [PATCH] squiggles --- frontend/src/Widget.jsx | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/frontend/src/Widget.jsx b/frontend/src/Widget.jsx index e5d6c3f..37417a4 100644 --- a/frontend/src/Widget.jsx +++ b/frontend/src/Widget.jsx @@ -255,7 +255,7 @@ function Widget() { useEffect(() => { console.log('window.location', window.location); - widgetApi.current = new WidgetApi('50aaf929-a90d-4507-9ecc-cd0620d1c780'); + widgetApi.current = widgetApi.current ?? new WidgetApi('50aaf929-a90d-4507-9ecc-cd0620d1c780'); console.log('widget api', widgetApi.current); @@ -275,10 +275,6 @@ function Widget() { }); widgetApi.current.start(); - // window.widgetApiPromise.then((api) => { - // console.log('widgetApi promise resolved', api); - // widgetApi.current = api; - // }); }, []); /* -------------------------------------------------------------------------------- */ @@ -367,7 +363,7 @@ function Widget() { const registerMatrixIdentity = async () => { const sendMessageCapability = WidgetEventCapability.forRoomEvent( EventDirection.Send, - 'm.message', + 'm.room.message', ); widgetApi.current.requestCapability(sendMessageCapability); await widgetApi.current.updateRequestedCapabilities();