mirror of
https://github.com/ecency/ecency-mobile.git
synced 2024-12-15 08:32:45 +03:00
using local data from otherAccounts instead of realm, comparing by username instead of name
This commit is contained in:
parent
f4c5c6ac2d
commit
ac63562e9c
@ -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);
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user