Skip to content

Commit

Permalink
fix: sending actual object to change join rule instead of empty object
Browse files Browse the repository at this point in the history
  • Loading branch information
aofn committed Dec 5, 2023
1 parent 820d510 commit a0c9c3f
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion pages/explore/manage-room/ChangeJoinRule.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,16 @@ const JoinRuleChanger = ({ roomId, roomName, onCancel }) => {
const handleChangeJoinRule = async (e) => {
e.preventDefault();
setChangingJoinRule(true);
await matrixClient.sendStateEvent(roomId, 'm.room.join_rules', {}, { join_rule: joinRule })
await matrixClient.sendStateEvent(roomId, 'm.room.join_rules', { join_rule: joinRule })
.catch((error) => {
setErrorMessage(error.data?.error);
setJoinRule(currentJoinRule);
});
setChangingJoinRule(false);
};

console.log(joinRule);

return (
<Form onSubmit={handleChangeJoinRule}>
<h1>{ t('Change Join Rule for') } { roomName }</h1>
Expand Down

0 comments on commit a0c9c3f

Please sign in to comment.