mirror of
https://github.com/filecoin-project/slate.git
synced 2024-11-22 21:45:56 +03:00
fix: status bug on peers tab on pages
This commit is contained in:
parent
10b62db028
commit
09a962257f
@ -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({
|
||||
|
@ -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",
|
||||
|
Loading…
Reference in New Issue
Block a user