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:
Timo 2024-04-12 15:27:21 +02:00 committed by GitHub
parent 14cc44e820
commit 313b556044
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 5 additions and 3 deletions

View file

@ -79,7 +79,6 @@ export const CallGuestLinkButton: React.FC<{ room: Room }> = ({ room }) => {
// If the user cannot invite the Knocking is not given as an option.
canInvite,
}).finished.then(() => {
// we need to use the function here because the callback got called before the state was updated.
if (isRoomJoinable()) showLinkModal();
});
}