From 6f4b2855a8ccc1469f1a0206d02bf645f467dce1 Mon Sep 17 00:00:00 2001 From: Ladd Hoffman Date: Thu, 25 Apr 2024 22:08:42 -0500 Subject: [PATCH] twiddle --- frontend/src/Widget.jsx | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/frontend/src/Widget.jsx b/frontend/src/Widget.jsx index 7679ff8..8b7e2f0 100644 --- a/frontend/src/Widget.jsx +++ b/frontend/src/Widget.jsx @@ -274,16 +274,16 @@ function Widget() { widgetApi.current.on('ready', (e) => { console.log('WIDGET READY', e); + + const sendMessageCapability = WidgetEventCapability.forRoomEvent( + EventDirection.Send, + 'm.room.message', + ); + widgetApi.current.requestCapability(sendMessageCapability.raw); + widgetApi.current.updateRequestedCapabilities(); }); widgetApi.current.start(); - - const sendMessageCapability = WidgetEventCapability.forRoomEvent( - EventDirection.Send, - 'm.room.message', - ); - widgetApi.current.requestCapability(sendMessageCapability.raw); - widgetApi.current.updateRequestedCapabilities(); }, []); /* -------------------------------------------------------------------------------- */ @@ -370,7 +370,7 @@ function Widget() { // TODO: Sign and send a message to the forum-api bot / to a room in matrix const registerMatrixIdentity = async () => { - await widgetApi.current.sendRoomEvent('m.message', 'test message', '!HMoNkuTRLqQGhhlMNO:matrix.dgov.io'); + await widgetApi.current.sendRoomEvent('m.message', 'test message'); }; /* -------------------------------------------------------------------------------- */