use only posting_json_metadata or nothing

This commit is contained in:
feruz 2020-08-14 11:44:03 +03:00
parent b9e5df0373
commit dac97c550e
2 changed files with 4 additions and 8 deletions

View File

@ -64,8 +64,7 @@ export const login = async (username, password, isPinCodeOpen) => {
let jsonMetadata;
try {
jsonMetadata =
JSON.parse(account.posting_json_metadata) || JSON.parse(account.json_metadata) || '';
jsonMetadata = JSON.parse(account.posting_json_metadata) || '';
} catch (err) {
jsonMetadata = '';
}
@ -124,8 +123,7 @@ export const loginWithSC2 = async (code, isPinCodeOpen) => {
return new Promise(async (resolve, reject) => {
let jsonMetadata;
try {
jsonMetadata =
JSON.parse(account.posting_json_metadata) || JSON.parse(account.json_metadata) || '';
jsonMetadata = JSON.parse(account.posting_json_metadata) || '';
if (Object.keys(jsonMetadata).length !== 0) {
avatar = jsonMetadata.profile.profile_image || '';
}

View File

@ -201,11 +201,9 @@ export const getUser = async (user) => {
get(globalProperties, 'total_vesting_fund_steem', globalProperties.total_vesting_fund_hive),
);
if (has(_account, 'posting_json_metadata') || has(_account, 'json_metadata')) {
if (has(_account, 'posting_json_metadata')) {
try {
_account.about =
JSON.parse(get(_account, 'posting_json_metadata')) ||
JSON.parse(get(_account, 'json_metadata'));
_account.about = JSON.parse(get(_account, 'posting_json_metadata'));
} catch (e) {
//alert(e);
_account.about = {};