chat-js: transition to new chat upon chatSynced changing in join or new chat screen

This commit is contained in:
Logan Allen 2020-04-02 23:03:28 -04:00
parent 5faaa6c710
commit 7eb499abda
2 changed files with 4 additions and 1 deletions

View File

@ -46,7 +46,8 @@ export class JoinScreen extends Component {
componentDidUpdate(prevProps, prevState) {
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}`);
}
}

View File

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