fix: status bug on peers tab on pages

This commit is contained in:
Akuoko Daniel Jnr 2021-02-09 17:42:27 +00:00
parent 10b62db028
commit 09a962257f
No known key found for this signature in database
GPG Key ID: 1C95803CACD3E9DC
2 changed files with 11 additions and 16 deletions

View File

@ -239,7 +239,7 @@ function UserEntry({
message,
external,
url,
userOnline,
checkStatus,
showStatusIndicator,
}) {
return (
@ -254,8 +254,8 @@ function UserEntry({
<div
css={STYLES_DIRECTORY_STATUS_INDICATOR}
style={{
borderColor: userOnline && `${Constants.system.active}`,
backgroundColor: userOnline && `${Constants.system.active}`,
borderColor: checkStatus(user.id) && `${Constants.system.active}`,
backgroundColor: checkStatus(user.id) && `${Constants.system.active}`,
}}
/>
)}
@ -274,8 +274,8 @@ function UserEntry({
<div
css={STYLES_DIRECTORY_STATUS_INDICATOR}
style={{
borderColor: userOnline && `${Constants.system.active}`,
backgroundColor: userOnline && `${Constants.system.active}`,
borderColor: checkStatus(user.id) && `${Constants.system.active}`,
backgroundColor: checkStatus(user.id) && `${Constants.system.active}`,
}}
/>
</div>
@ -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({

View File

@ -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 (
<div key={user.username} css={STYLES_USER_ENTRY}>
<div css={STYLES_USER} onClick={onClick}>
@ -120,8 +120,8 @@ function UserEntry({ user, button, onClick, message, userOnline }) {
<div
css={STYLES_STATUS_INDICATOR}
style={{
borderColor: userOnline && `${Constants.system.active}`,
backgroundColor: userOnline && `${Constants.system.active}`,
borderColor: checkStatus(user.id) && `${Constants.system.active}`,
backgroundColor: checkStatus(user.id) && `${Constants.system.active}`,
}}
/>
</div>
@ -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",