diff --git a/components/core/Profile.js b/components/core/Profile.js index d0e589be..407dd44f 100644 --- a/components/core/Profile.js +++ b/components/core/Profile.js @@ -242,6 +242,8 @@ function UserEntry({ checkStatus, showStatusIndicator, }) { + const isOnline = checkStatus({ id: user.id }); + return (
{external ? ( @@ -254,8 +256,8 @@ function UserEntry({
)} @@ -274,8 +276,8 @@ function UserEntry({
@@ -402,10 +404,9 @@ export default class Profile extends React.Component { }); }; - checkStatus = (userId) => { - const activeUsers = this.props.activeUsers; - - return activeUsers && activeUsers.includes(userId); + checkStatus = ({ id }) => { + const { activeUsers } = this.props; + return activeUsers && activeUsers.includes(id); }; render() { @@ -580,9 +581,9 @@ export default class Profile extends React.Component { css={STYLES_STATUS_INDICATOR} style={{ borderColor: - this.checkStatus(this.props.data?.id) && `${Constants.system.active}`, + this.checkStatus({ id: this.props.data?.id }) && `${Constants.system.active}`, backgroundColor: - this.checkStatus(this.props.data?.id) && `${Constants.system.active}`, + this.checkStatus({ id: this.props.data?.id }) && `${Constants.system.active}`, }} /> )} diff --git a/scenes/SceneDirectory.js b/scenes/SceneDirectory.js index d8facb06..6407f4c0 100644 --- a/scenes/SceneDirectory.js +++ b/scenes/SceneDirectory.js @@ -113,6 +113,8 @@ const STYLES_NAME = css` `; function UserEntry({ user, button, onClick, message, checkStatus }) { + const isOnline = checkStatus({ id: user.id }); + return (
@@ -120,8 +122,8 @@ function UserEntry({ user, button, onClick, message, checkStatus }) {
@@ -191,10 +193,10 @@ export default class SceneDirectory extends React.Component { }); }; - checkStatus = (userId) => { - const activeUsers = this.props.activeUsers; + checkStatus = ({ id }) => { + const { activeUsers } = this.props; - return activeUsers && activeUsers.includes(userId); + return activeUsers && activeUsers.includes(id); }; render() { @@ -283,7 +285,7 @@ export default class SceneDirectory extends React.Component { key={relation.id} user={relation.owner} button={button} - userOnline={this.checkStatus(relation.id)} + checkStatus={this.checkStatus} onClick={() => { this.props.onAction({ type: "NAVIGATE",