try to send a matrix message
Gitea Actions Demo / Explore-Gitea-Actions (push) Failing after 33s Details

This commit is contained in:
Ladd Hoffman 2024-04-24 18:01:58 -05:00
parent bcb03eb452
commit 0319853bc4
1 changed files with 7 additions and 18 deletions

View File

@ -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() {
<div>
<Button onClick={() => disconnect()}>Disconnect</Button>
<Button onClick={() => watchReputationToken()}>Watch REP in MetaMask</Button>
{!!widgetId && (
<Button onClick={() => registerMatrixIdentity()}>
Register Matrix Identity
</Button>
)}
<Button onClick={() => registerMatrixIdentity()}>
Register Matrix Identity
</Button>
</div>
</Stack>
</Col>