From 09a962257f6cb5c46645521c700c7096b885d3f3 Mon Sep 17 00:00:00 2001 From: Akuoko Daniel Jnr Date: Tue, 9 Feb 2021 17:42:27 +0000 Subject: [PATCH] fix: status bug on peers tab on pages --- components/core/Profile.js | 15 +++++++-------- scenes/SceneDirectory.js | 12 ++++-------- 2 files changed, 11 insertions(+), 16 deletions(-) diff --git a/components/core/Profile.js b/components/core/Profile.js index b39e8183..d0e589be 100644 --- a/components/core/Profile.js +++ b/components/core/Profile.js @@ -239,7 +239,7 @@ function UserEntry({ message, external, url, - userOnline, + checkStatus, showStatusIndicator, }) { return ( @@ -254,8 +254,8 @@ function UserEntry({
)} @@ -274,8 +274,8 @@ function UserEntry({
@@ -315,7 +315,6 @@ export default class Profile extends React.Component { componentDidMount = () => { this._handleUpdatePage(); this.filterByVisibility(); - this.checkStatus(); }; componentDidUpdate = (prevProps) => { @@ -477,7 +476,7 @@ export default class Profile extends React.Component { key={relation.id} user={relation.user} button={button} - userOnline={this.checkStatus(relation.id)} + checkStatus={this.checkStatus} showStatusIndicator={this.props.isAuthenticated} onClick={() => { this.props.onAction({ @@ -531,7 +530,7 @@ export default class Profile extends React.Component { key={relation.id} user={relation.owner} button={button} - userOnline={this.checkStatus(relation.id)} + checkStatus={this.checkStatus} showStatusIndicator={this.props.isAuthenticated} onClick={() => { this.props.onAction({ diff --git a/scenes/SceneDirectory.js b/scenes/SceneDirectory.js index 71ebdbd4..d8facb06 100644 --- a/scenes/SceneDirectory.js +++ b/scenes/SceneDirectory.js @@ -112,7 +112,7 @@ const STYLES_NAME = css` text-overflow: ellipsis; `; -function UserEntry({ user, button, onClick, message, userOnline }) { +function UserEntry({ user, button, onClick, message, checkStatus }) { return (
@@ -120,8 +120,8 @@ function UserEntry({ user, button, onClick, message, userOnline }) {
@@ -161,10 +161,6 @@ export default class SceneDirectory extends React.Component { contextMenu: null, }; - componentDidMount = () => { - this.checkStatus(); - }; - _handleCopy = (e, value) => { e.stopPropagation(); this.setState({ copyValue: value }, () => { @@ -238,7 +234,7 @@ export default class SceneDirectory extends React.Component { key={relation.id} user={relation.user} button={button} - userOnline={this.checkStatus(relation.id)} + checkStatus={this.checkStatus} onClick={() => { this.props.onAction({ type: "NAVIGATE",