Fix link modal not shown after access upgrade (#12411)
* Fix link modal not shown after access upgrade We dont show the modal since there was a mistake in the isRoomJoinable function. It used a state variable instead of reacomputing the join rule with room.getJoinRule() The state is a captured variable that from before the link share click -> does not update at that time. * dont shadow var
This commit is contained in:
parent
14cc44e820
commit
313b556044
2 changed files with 5 additions and 3 deletions
|
@ -52,7 +52,10 @@ export const useGuestAccessInformation = (room: Room): GuestAccessInformation =>
|
|||
[canChangeJoinRule, isRoomJoinable, guestSpaUrl],
|
||||
);
|
||||
|
||||
const isRoomJoinableFunction = (): boolean =>
|
||||
room.getJoinRule() === JoinRule.Public || (joinRule === JoinRule.Knock && room.canInvite(room.myUserId));
|
||||
const isRoomJoinableFunction = (): boolean => {
|
||||
const join = room.getJoinRule();
|
||||
return join === JoinRule.Public || (join === JoinRule.Knock && room.canInvite(room.myUserId));
|
||||
};
|
||||
|
||||
return { canInviteGuests, guestSpaUrl, isRoomJoinable: isRoomJoinableFunction, canInvite };
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue