fix wallet asset names, profile page bug fix

This commit is contained in:
feruz 2020-04-10 11:12:00 +03:00
parent 18600104dc
commit c777ac7946
3 changed files with 46 additions and 37 deletions

View File

@ -1,4 +1,6 @@
{ {
"editor.formatOnSave": true, "eslint.validate": [
"eslint.validate": ["javascript", "javascriptreact"] "javascript",
"javascriptreact"
]
} }

View File

@ -40,7 +40,7 @@ const WalletDetailsView = ({ walletData, intl, navigate, isShowDropdowns }) => {
iconName="ios-information-circle-outline" iconName="ios-information-circle-outline"
rightText={`${ rightText={`${
Math.round(vestsToSp(walletData.vestingShares, walletData.steemPerMVests) * 1000) / 1000 Math.round(vestsToSp(walletData.vestingShares, walletData.steemPerMVests) * 1000) / 1000
} SP`} } HP`}
isBoldText isBoldText
isHasdropdown={isShowDropdowns} isHasdropdown={isShowDropdowns}
dropdownOptions={steemPowerDropdown.map((item) => dropdownOptions={steemPowerDropdown.map((item) =>
@ -55,7 +55,7 @@ const WalletDetailsView = ({ walletData, intl, navigate, isShowDropdowns }) => {
Math.round( Math.round(
vestsToSp(walletData.vestingSharesDelegated, walletData.steemPerMVests) * 1000, vestsToSp(walletData.vestingSharesDelegated, walletData.steemPerMVests) * 1000,
) / 1000 ) / 1000
} SP`} } HP`}
style={styles.walletLineDetail} style={styles.walletLineDetail}
/> />
)} )}
@ -65,7 +65,7 @@ const WalletDetailsView = ({ walletData, intl, navigate, isShowDropdowns }) => {
Math.round( Math.round(
vestsToSp(walletData.vestingSharesReceived, walletData.steemPerMVests) * 1000, vestsToSp(walletData.vestingSharesReceived, walletData.steemPerMVests) * 1000,
) / 1000 ) / 1000
} SP`} } HP`}
style={styles.walletLineDetail} style={styles.walletLineDetail}
/> />
)} )}
@ -75,7 +75,7 @@ const WalletDetailsView = ({ walletData, intl, navigate, isShowDropdowns }) => {
Math.round( Math.round(
vestsToSp(walletData.vestingSharesTotal, walletData.steemPerMVests) * 1000, vestsToSp(walletData.vestingSharesTotal, walletData.steemPerMVests) * 1000,
) / 1000 ) / 1000
} SP`} } HP`}
rightTextColor="#357ce6" rightTextColor="#357ce6"
style={styles.walletLineDetail} style={styles.walletLineDetail}
/> />
@ -101,7 +101,7 @@ const WalletDetailsView = ({ walletData, intl, navigate, isShowDropdowns }) => {
})} })}
isBlackText isBlackText
iconName="ios-information-circle-outline" iconName="ios-information-circle-outline"
rightText={`${Math.round(walletData.savingBalance * 1000) / 1000} STEEM`} rightText={`${Math.round(walletData.savingBalance * 1000) / 1000} HIVE`}
isBoldText isBoldText
isHasdropdown={isShowDropdowns} isHasdropdown={isShowDropdowns}
dropdownOptions={savingSteemDropdown.map((item) => dropdownOptions={savingSteemDropdown.map((item) =>

View File

@ -107,7 +107,6 @@ export const fetchGlobalProps = async () => {
export const getAccount = (user) => export const getAccount = (user) =>
new Promise((resolve, reject) => { new Promise((resolve, reject) => {
try { try {
console.log('user', user);
const account = client.database.getAccounts([user]); const account = client.database.getAccounts([user]);
resolve(account); resolve(account);
} catch (error) { } catch (error) {
@ -134,8 +133,6 @@ export const getState = async (path) => {
*/ */
export const getUser = async (user) => { export const getUser = async (user) => {
try { try {
console.log('user1', user);
const account = await client.database.getAccounts([user]); const account = await client.database.getAccounts([user]);
const _account = { const _account = {
...account[0], ...account[0],
@ -147,9 +144,11 @@ export const getUser = async (user) => {
} }
const globalProperties = await client.database.getDynamicGlobalProperties(); const globalProperties = await client.database.getDynamicGlobalProperties();
const rcPower = await client.call('rc_api', 'find_rc_accounts', { const rcPower =
accounts: [user], user &&
}); (await client.call('rc_api', 'find_rc_accounts', {
accounts: [user],
}));
try { try {
unreadActivityCount = await getUnreadActivityCount({ unreadActivityCount = await getUnreadActivityCount({
user, user,
@ -262,34 +261,42 @@ export const getFollowers = (follower, startFollowing, followType = 'blog', limi
export const getIsFollowing = (user, author) => export const getIsFollowing = (user, author) =>
new Promise((resolve, reject) => { new Promise((resolve, reject) => {
client.database if (author) {
.call('get_following', [author, user, 'blog', 1]) client.database
.then((result) => { .call('get_following', [author, user, 'blog', 1])
if (result[0] && result[0].follower === author && result[0].following === user) { .then((result) => {
resolve(true); if (result[0] && result[0].follower === author && result[0].following === user) {
} else { resolve(true);
resolve(false); } else {
} resolve(false);
}) }
.catch((err) => { })
reject(err); .catch((err) => {
}); reject(err);
});
} else {
resolve(false);
}
}); });
export const getFollowSearch = (user, targetUser) => export const getFollowSearch = (user, targetUser) =>
new Promise((resolve, reject) => { new Promise((resolve, reject) => {
client.database if (targetUser) {
.call('get_following', [targetUser, user, 'blog', 1]) client.database
.then((result) => { .call('get_following', [targetUser, user, 'blog', 1])
if (result[0] && result[0].follower === targetUser && result[0].following === user) { .then((result) => {
resolve(result); if (result[0] && result[0].follower === targetUser && result[0].following === user) {
} else { resolve(result);
resolve(null); } else {
} resolve(null);
}) }
.catch((err) => { })
reject(err); .catch((err) => {
}); reject(err);
});
} else {
resolve(null);
}
}); });
export const getIsMuted = async (targetUsername, username) => { export const getIsMuted = async (targetUsername, username) => {