From ac63562e9ced71593159a8fd5e80197175d80264 Mon Sep 17 00:00:00 2001 From: Nouman Tahir Date: Tue, 24 Jan 2023 22:49:12 +0500 Subject: [PATCH] using local data from otherAccounts instead of realm, comparing by username instead of name --- src/containers/redeemContainer.js | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) diff --git a/src/containers/redeemContainer.js b/src/containers/redeemContainer.js index d7bb5c968..61a67b53d 100644 --- a/src/containers/redeemContainer.js +++ b/src/containers/redeemContainer.js @@ -7,7 +7,6 @@ import { injectIntl } from 'react-intl'; import { useNavigation } from '@react-navigation/native'; import { promote, boost, isPostAvailable } from '../providers/hive/dhive'; import { toastNotification } from '../redux/actions/uiAction'; -import { getUserDataWithUsername } from '../realm/realm'; /* * Props Name Description Value @@ -88,7 +87,7 @@ class RedeemContainer extends Component { }; _handleOnSubmit = async (redeemType, actionSpecificParam, fullPermlink, selectedUser) => { - const { intl, currentAccount } = this.props; + const { intl, currentAccount, accounts } = this.props; const separatedPermlink = fullPermlink.split('/'); const _author = get(separatedPermlink, '[0]'); const _permlink = get(separatedPermlink, '[1]'); @@ -99,18 +98,7 @@ class RedeemContainer extends Component { return; } - let userFromRealm; - - if (selectedUser) { - userFromRealm = await getUserDataWithUsername(selectedUser); - } - - const user = userFromRealm - ? { - name: selectedUser, - local: userFromRealm[0], - } - : currentAccount; + const user = selectedUser !== currentAccount.username ? currentAccount : accounts.find(item=>item.username === selectedUser); this._redeemAction(redeemType, actionSpecificParam, _permlink, _author, user); };