mirror of
https://github.com/ecency/ecency-mobile.git
synced 2024-12-22 21:01:31 +03:00
Changed updatePinCode function with new structure
This commit is contained in:
parent
b60aa8be4a
commit
7a329d5ceb
@ -158,6 +158,8 @@ export const setUserDataWithPinCode = async (data) => {
|
||||
export const updatePinCode = async (data) => {
|
||||
let password = null;
|
||||
let accessToken = null;
|
||||
try {
|
||||
await setPinCode(data.pinCode);
|
||||
const users = await getUserData();
|
||||
if (users.length > 0) {
|
||||
users.forEach(async (userData) => {
|
||||
@ -177,15 +179,13 @@ export const updatePinCode = async (data) => {
|
||||
activeKey: encryptKey(privateKeys.active.toString(), data.pinCode),
|
||||
memoKey: encryptKey(privateKeys.memo.toString(), data.pinCode),
|
||||
};
|
||||
const response = await updateUserData(updatedUserData);
|
||||
const authData = {
|
||||
isLoggedIn: true,
|
||||
currentUsername: userData.username,
|
||||
};
|
||||
|
||||
await setAuthStatus(authData);
|
||||
return response;
|
||||
await updateUserData(updatedUserData);
|
||||
});
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
} catch (error) {
|
||||
return Promise.reject(new Error('Unknown error, please contact to eSteem.'));
|
||||
}
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user