Fixed pin close issue

This commit is contained in:
Mustafa Buyukcelebi 2019-08-29 13:54:48 +03:00
parent b2bee19402
commit 0200ec4f40

View File

@ -171,9 +171,9 @@ export const updatePinCode = data =>
let currentUser = null; let currentUser = null;
try { try {
setPinCode(data.pinCode); setPinCode(data.pinCode);
getUserData().then(users => { getUserData().then(async users => {
if (users && users.length > 0) { if (users && users.length > 0) {
users.forEach(userData => { await users.forEach(userData => {
if (userData.authType === AUTH_TYPE.MASTER_KEY) { if (userData.authType === AUTH_TYPE.MASTER_KEY) {
data.password = decryptKey(userData.masterKey, data.oldPinCode); data.password = decryptKey(userData.masterKey, data.oldPinCode);
} else if (userData.authType === AUTH_TYPE.STEEM_CONNECT) { } else if (userData.authType === AUTH_TYPE.STEEM_CONNECT) {
@ -184,8 +184,8 @@ export const updatePinCode = data =>
if (userData.username === data.username) { if (userData.username === data.username) {
currentUser = updatedUserData; currentUser = updatedUserData;
} }
resolve(currentUser);
}); });
resolve(currentUser);
} }
}); });
} catch (error) { } catch (error) {