diff --git a/src/script/auth/page/ConversationJoin.tsx b/src/script/auth/page/ConversationJoin.tsx index eaa423cbca8d..c400b700dbe1 100644 --- a/src/script/auth/page/ConversationJoin.tsx +++ b/src/script/auth/page/ConversationJoin.tsx @@ -60,13 +60,13 @@ const ConversationJoinComponent = ({ doRegisterWireless, setLastEventDate, doLogout, - selfName, + self, conversationError, }: Props & ConnectedProps & DispatchProps) => { const nameInput = React.useRef(null); const {formatMessage: _} = useIntl(); + const [isLoggedIn, setIsLoggedIn] = useState(); - const [isLoggedIn, setIsLoggedIn] = useState(selfName !== null); const [accentColor] = useState(AccentColor.STRONG_BLUE); const [conversationCode, setConversationCode] = useState(); const [conversationKey, setConversationKey] = useState(); @@ -101,6 +101,12 @@ const ConversationJoinComponent = ({ }); }, []); + useEffect(() => { + if (self) { + setIsLoggedIn(true); + } + }, [self]); + const routeToApp = (conversation: string = '', domain: string = '') => { const redirectLocation = `${UrlUtil.pathWithParams(EXTERNAL_ROUTE.WEBAPP)}${ conversation && `#/conversation/${conversation}${domain && `/${domain}`}` @@ -218,8 +224,8 @@ const ConversationJoinComponent = ({ - {isLoggedIn ? ( - + {isLoggedIn && self.name ? ( + ) : ( )} @@ -256,7 +262,7 @@ const mapStateToProps = (state: RootState) => ({ isAuthenticated: AuthSelector.isAuthenticated(state), isFetching: ConversationSelector.isFetching(state), isTemporaryGuest: SelfSelector.isTemporaryGuest(state), - selfName: SelfSelector.getSelfName(state), + self: SelfSelector.getSelf(state), }); type DispatchProps = ReturnType;