mirror of
https://github.com/ecency/ecency-mobile.git
synced 2024-12-22 21:01:31 +03:00
Refactoring for application container
This commit is contained in:
parent
7ff067f5af
commit
e2554884be
@ -70,7 +70,7 @@ import {
|
|||||||
isDefaultFooter,
|
isDefaultFooter,
|
||||||
} from '../../../redux/actions/applicationActions';
|
} from '../../../redux/actions/applicationActions';
|
||||||
|
|
||||||
// Container
|
// Screens
|
||||||
import ApplicationScreen from '../screen/applicationScreen';
|
import ApplicationScreen from '../screen/applicationScreen';
|
||||||
import { Launch } from '../..';
|
import { Launch } from '../..';
|
||||||
|
|
||||||
@ -334,14 +334,14 @@ class ApplicationContainer extends Component {
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
_logout = async () => {
|
_logout = () => {
|
||||||
const {
|
const {
|
||||||
otherAccounts,
|
otherAccounts,
|
||||||
currentAccount: { name, local },
|
currentAccount: { name, local },
|
||||||
dispatch,
|
dispatch,
|
||||||
} = this.props;
|
} = this.props;
|
||||||
|
|
||||||
await removeUserData(name)
|
removeUserData(name)
|
||||||
.then(async () => {
|
.then(async () => {
|
||||||
const _otherAccounts = otherAccounts.filter(user => user.username !== name);
|
const _otherAccounts = otherAccounts.filter(user => user.username !== name);
|
||||||
|
|
||||||
@ -388,14 +388,14 @@ class ApplicationContainer extends Component {
|
|||||||
_switchAccount = async targetAccountUsername => {
|
_switchAccount = async targetAccountUsername => {
|
||||||
const { dispatch } = this.props;
|
const { dispatch } = this.props;
|
||||||
|
|
||||||
await switchAccount(targetAccountUsername).then(accountData => {
|
const accountData = await switchAccount(targetAccountUsername);
|
||||||
|
|
||||||
const realmData = getUserDataWithUsername(targetAccountUsername);
|
const realmData = getUserDataWithUsername(targetAccountUsername);
|
||||||
const _currentAccount = accountData;
|
const _currentAccount = accountData;
|
||||||
_currentAccount.username = accountData.name;
|
_currentAccount.username = accountData.name;
|
||||||
[_currentAccount.local] = realmData;
|
[_currentAccount.local] = realmData;
|
||||||
|
|
||||||
dispatch(updateCurrentAccount(_currentAccount));
|
dispatch(updateCurrentAccount(_currentAccount));
|
||||||
});
|
|
||||||
};
|
};
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
|
Loading…
Reference in New Issue
Block a user