mirror of
https://github.com/ecency/ecency-mobile.git
synced 2024-11-29 22:07:46 +03:00
Merge branch 'development' of github.com:esteemapp/esteem-mobile into bugfix/post-display
This commit is contained in:
commit
37068dea8a
@ -73,8 +73,8 @@ class SideMenuContainer extends Component {
|
||||
const { dispatch, currentAccount, navigation } = this.props;
|
||||
|
||||
if (anchor !== currentAccount.name) {
|
||||
switchAccount(anchor).then(accountData => {
|
||||
const realmData = getUserDataWithUsername(anchor);
|
||||
switchAccount(anchor).then(async accountData => {
|
||||
const realmData = await getUserDataWithUsername(anchor);
|
||||
const _currentAccount = accountData;
|
||||
|
||||
_currentAccount.username = _currentAccount.name;
|
||||
|
1103
src/realm/realm.js
1103
src/realm/realm.js
File diff suppressed because it is too large
Load Diff
@ -441,43 +441,41 @@ class ApplicationContainer extends Component {
|
||||
_getUserDataFromRealm = async () => {
|
||||
const { dispatch, pinCode, isPinCodeOpen: _isPinCodeOpen } = this.props;
|
||||
let realmData = [];
|
||||
let currentUsername;
|
||||
|
||||
await getAuthStatus().then(res => {
|
||||
({ currentUsername } = res);
|
||||
const res = await getAuthStatus();
|
||||
const { currentUsername } = res;
|
||||
|
||||
if (res) {
|
||||
getUserData().then(async userData => {
|
||||
if (userData.length > 0) {
|
||||
realmData = userData;
|
||||
userData.forEach((accountData, index) => {
|
||||
if (
|
||||
!accountData.accessToken &&
|
||||
!accountData.masterKey &&
|
||||
!accountData.postingKey &&
|
||||
!accountData.activeKey &&
|
||||
!accountData.memoKey
|
||||
) {
|
||||
realmData.splice(index, 1);
|
||||
if (realmData.length === 0) {
|
||||
dispatch(login(false));
|
||||
dispatch(logoutDone());
|
||||
removePinCode();
|
||||
setAuthStatus({ isLoggedIn: false });
|
||||
setExistUser(false);
|
||||
if (accountData.authType === AUTH_TYPE.STEEM_CONNECT) {
|
||||
removeSCAccount(accountData.username);
|
||||
}
|
||||
}
|
||||
removeUserData(accountData.username);
|
||||
} else {
|
||||
dispatch(addOtherAccount({ username: accountData.username }));
|
||||
if (res) {
|
||||
const userData = await getUserData();
|
||||
|
||||
if (userData.length > 0) {
|
||||
realmData = userData;
|
||||
userData.forEach((accountData, index) => {
|
||||
if (
|
||||
!accountData.accessToken &&
|
||||
!accountData.masterKey &&
|
||||
!accountData.postingKey &&
|
||||
!accountData.activeKey &&
|
||||
!accountData.memoKey
|
||||
) {
|
||||
realmData.splice(index, 1);
|
||||
if (realmData.length === 0) {
|
||||
dispatch(login(false));
|
||||
dispatch(logoutDone());
|
||||
removePinCode();
|
||||
setAuthStatus({ isLoggedIn: false });
|
||||
setExistUser(false);
|
||||
if (accountData.authType === AUTH_TYPE.STEEM_CONNECT) {
|
||||
removeSCAccount(accountData.username);
|
||||
}
|
||||
});
|
||||
}
|
||||
removeUserData(accountData.username);
|
||||
} else {
|
||||
dispatch(addOtherAccount({ username: accountData.username }));
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
if (realmData.length > 0) {
|
||||
const realmObject = realmData.filter(data => data.username === currentUsername);
|
||||
|
@ -165,7 +165,7 @@ const parseActiveVotes = (post, currentUserName) => {
|
||||
|
||||
if (!isEmpty(post.active_votes)) {
|
||||
forEach(post.active_votes, value => {
|
||||
post.vote_perecent = value.voter === currentUserName ? value.percent : null;
|
||||
post.vote_percent = value.voter === currentUserName ? value.percent : null;
|
||||
value.value = (value.rshares * ratio).toFixed(3);
|
||||
value.reputation = getReputation(get(value, 'reputation'));
|
||||
value.percent /= 100;
|
||||
|
Loading…
Reference in New Issue
Block a user