diff --git a/frontend/src/Widget.jsx b/frontend/src/Widget.jsx index 3c8b6e4..dafd6ab 100644 --- a/frontend/src/Widget.jsx +++ b/frontend/src/Widget.jsx @@ -244,37 +244,14 @@ function Widget() { /* --------------------------- END MAIN INITIALIZION EFFECT ----------------------- */ /* -------------------------------------------------------------------------------- */ - // useEffect(() => { - // // api.requestCapability(MatrixCapabilities.) - // api.on('action:m.message', (ev) => { - // console.log('action:m.message', ev); - // }); - // api.start(); - // }, []); - useEffect(() => { console.log('window.location', window.location); const { searchParams } = new URL(window.location.href); const widgetId = searchParams.get('widgetId'); - widgetApi.current = widgetApi.current ?? new WidgetApi(widgetId, 'https://chat.dgov.io'); - - console.log('widget api', widgetApi.current); - - // widgetApi.current.requestCapability(MatrixCapabilities.AlwaysOnScreen); - - // widgetApi.current.requestCapabilities([ - // WidgetEventCapability.forRoomEvent( - // EventDirection.Send, - // 'm.message', - // ), - // ]); - - // widgetApi.current.updateRequestedCapabilities(); - - widgetApi.current.on('ready', (e) => { - console.log('WIDGET READY', e); + widgetApi.current = widgetApi.current ?? new WidgetApi(widgetId, '*'); + widgetApi.current.on('ready', () => { const sendMessageCapability = WidgetEventCapability.forRoomEvent( EventDirection.Send, 'm.room.message',