From 3621703d44a284dfe96f040694f049bb14df5a21 Mon Sep 17 00:00:00 2001 From: Martina Date: Sun, 30 Aug 2020 20:49:12 -0700 Subject: [PATCH] fix for pendingTrusted bug --- components/core/Profile.js | 6 ++---- node_common/managers/viewer.js | 2 +- scenes/SceneProfile.js | 9 --------- 3 files changed, 3 insertions(+), 14 deletions(-) diff --git a/components/core/Profile.js b/components/core/Profile.js index 98e09f1d..37a1e2f8 100644 --- a/components/core/Profile.js +++ b/components/core/Profile.js @@ -33,16 +33,14 @@ const STYLES_LINK = css` export default class Profile extends React.Component { render() { - let data = this.props.creator ? this.props.creator : this.props.data; //do we need this? + let data = this.props.creator ? this.props.creator : this.props.data; return (
-
{data.username}
- {/* TODO: replace with real name when added */} - {this.props.buttons} +
{data.username}
/{this.props.buttons}
{data.slates && data.slates.length ? (
diff --git a/node_common/managers/viewer.js b/node_common/managers/viewer.js index d368d003..7f13d18d 100644 --- a/node_common/managers/viewer.js +++ b/node_common/managers/viewer.js @@ -48,7 +48,7 @@ export const getById = async ({ id }) => { // NOTE(jim): This should be the cheapest call. const pendingTrusted = await Data.getPendingTrustedRelationshipsByUserId({ - userId: [], + userId: id, }); const r3 = await Serializers.doPendingTrusted({ users: [id], diff --git a/scenes/SceneProfile.js b/scenes/SceneProfile.js index 0626cb8f..89fd58e3 100644 --- a/scenes/SceneProfile.js +++ b/scenes/SceneProfile.js @@ -77,7 +77,6 @@ export default class SceneProfile extends React.Component { if (trust.length) { let relation = trust[0]; newState.trustId = relation.id; - console.log(relation.id); if (relation.data.verified) { newState.trustStatus = "trusted"; } else { @@ -90,7 +89,6 @@ export default class SceneProfile extends React.Component { if (pendingTrust.length) { let relation = pendingTrust[0]; newState.trustId = relation.id; - console.log(relation.id); if (pendingTrust[0].data.verified) { newState.trustStatus = "trusted"; } else { @@ -109,8 +107,6 @@ export default class SceneProfile extends React.Component { _handleUpdate = async (e) => { let response = await this.props.onRehydrate(); - // const response = await Actions.hydrateAuthenticatedUser(); - console.log(response); if (!response || response.error) { alert("TODO: error fetching authenticated viewer"); return null; @@ -127,24 +123,20 @@ export default class SceneProfile extends React.Component { this.state.trustStatus === "untrusted" || this.state.trustStatus === "sent" ) { - console.log(this.props.data); response = await Actions.createTrustRelationship({ userId: this.props.data.id, }); console.log(response); - console.log("cancel request or create trust"); } else if (this.state.trustStatus === "received") { response = await Actions.updateTrustRelationship({ userId: this.props.data.id, }); console.log(response); - console.log("accept"); } else { response = await Actions.deleteTrustRelationship({ id: this.state.trustId, }); console.log(response); - console.log("delete trust"); } await this._handleUpdate(); }; @@ -154,7 +146,6 @@ export default class SceneProfile extends React.Component { userId: this.props.data.id, }); console.log(response); - console.log("follow / unfollow"); await this._handleUpdate(); };