mirror of
https://github.com/ecency/ecency-mobile.git
synced 2024-12-15 00:23:34 +03:00
Fixed object errorm on application container
This commit is contained in:
parent
6e5871db29
commit
c03d93d62b
@ -105,7 +105,7 @@ class ApplicationContainer extends Component {
|
|||||||
userData.forEach((accountData, index) => {
|
userData.forEach((accountData, index) => {
|
||||||
if (!accountData.accessToken && !accountData.masterKey) {
|
if (!accountData.accessToken && !accountData.masterKey) {
|
||||||
realmData.splice(index, 1);
|
realmData.splice(index, 1);
|
||||||
removeUserData(accountData.username);
|
removeUserData(accountData);
|
||||||
} else {
|
} else {
|
||||||
dispatch(addOtherAccount({ username: accountData.username }));
|
dispatch(addOtherAccount({ username: accountData.username }));
|
||||||
}
|
}
|
||||||
@ -116,10 +116,10 @@ class ApplicationContainer extends Component {
|
|||||||
});
|
});
|
||||||
|
|
||||||
if (realmData.length > 0) {
|
if (realmData.length > 0) {
|
||||||
let realmObject = realmData.filter(data => data.username === currentUsername);
|
const realmObject = realmData.filter(data => data.username === currentUsername);
|
||||||
|
|
||||||
if (realmObject.length <= 0) {
|
if (realmObject.length <= 0) {
|
||||||
realmObject = realmData[realmData.length - 1];
|
realmObject[0] = realmData[realmData.length - 1];
|
||||||
await switchAccount(realmObject[0].username);
|
await switchAccount(realmObject[0].username);
|
||||||
}
|
}
|
||||||
await getUser(realmObject[0].username)
|
await getUser(realmObject[0].username)
|
||||||
|
Loading…
Reference in New Issue
Block a user