Merge pull request #2667 from urbit/la-chat-loading

chat-js: transition to new chat upon chatSynced changing in join or new chat screen
This commit is contained in:
ixv 2020-04-03 10:21:36 -07:00 committed by GitHub
commit 58b7f94e86
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 1 deletions

View File

@ -46,7 +46,8 @@ export class JoinScreen extends Component {
componentDidUpdate(prevProps, prevState) { componentDidUpdate(prevProps, prevState) {
const { props, state } = this; const { props, state } = this;
if (state.station in props.inbox) { if (state.station in props.inbox ||
props.chatSynced !== prevProps.chatSynced) {
props.history.push(`/~chat/room${state.station}`); props.history.push(`/~chat/room${state.station}`);
} }
} }

View File

@ -110,6 +110,7 @@ export class Root extends Component {
permissions={state.permissions || {}} permissions={state.permissions || {}}
contacts={state.contacts || {}} contacts={state.contacts || {}}
associations={associations.contacts} associations={associations.contacts}
chatSynced={state.chatSynced || {}}
{...props} {...props}
/> />
</Skeleton> </Skeleton>
@ -139,6 +140,7 @@ export class Root extends Component {
api={api} api={api}
inbox={state.inbox} inbox={state.inbox}
autoJoin={station} autoJoin={station}
chatSynced={state.chatSynced || {}}
{...props} /> {...props} />
</Skeleton> </Skeleton>
); );