diff --git a/frontend/src/App.jsx b/frontend/src/App.jsx index 9c6eae7..c444445 100644 --- a/frontend/src/App.jsx +++ b/frontend/src/App.jsx @@ -48,8 +48,6 @@ function App() { const [showAddPost, setShowAddPost] = useState(false); const [showViewPost, setShowViewPost] = useState(false); const [viewPost, setViewPost] = useState({}); - const [widgetId, setWidgetId] = useState(); - const [matrixUserId, setMatrixUserId] = useState(); const widgetApi = useRef(); const web3ProviderValue = useMemo(() => ({ provider, @@ -244,18 +242,11 @@ function App() { /* -------------------------------------------------------------------------------- */ useEffect(() => { - const params = new URL(document.location).searchParams; - console.log('params', params.toString()); - setWidgetId(params.get('widgetId')); - setMatrixUserId(params.get('userId')); + widgetApi.current = new WidgetApi(); + // const api = widgetApi.current; + // api.requestCapability(MatrixCapabilities.) }, []); - useEffect(() => { - if (widgetId) { - widgetApi.current = new WidgetApi(widgetId); - } - }, [widgetId]); - /* -------------------------------------------------------------------------------- */ /* --------------------------- BEGIN UI ACTIONS ----------------------------------- */ /* -------------------------------------------------------------------------------- */ @@ -340,7 +331,7 @@ function App() { // TODO: Sign and send a message to the forum-api bot / to a room in matrix const registerMatrixIdentity = async () => { - console.log('matrix user id', matrixUserId); + widgetApi.current.send('m.message', 'test message'); }; /* -------------------------------------------------------------------------------- */ @@ -394,11 +385,9 @@ function App() {