Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feature/logout-navigation #1297

Merged
merged 3 commits into from
Jul 31, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
### Bug

- Logout warning modal redirect to current page instead of home page [#1297](https://github.com/MyEtherWallet/MyEtherWallet/pull/1297)
- Custom networks not showing on send offline helper [#1285](https://github.com/MyEtherWallet/MyEtherWallet/pull/1285)

### Devop
Expand Down
2 changes: 1 addition & 1 deletion fetchLists/lists/contracts.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion fetchLists/lists/tokens.json

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions src/builds/web/app.vue
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,10 @@ export default {
this.$refs.welcome.$refs.welcome.$on('hidden', () => {
store.set('notFirstTimeVisit', true);
});

this.$refs.logoutWarningModal.$refs.logoutWarningModal.$on('hidden', () => {
window.scrollTo(0, 0);
});
},
destroyed() {
window.removeEventListener('PWA_UPDATED');
Expand Down
1 change: 0 additions & 1 deletion src/components/LogoutModal/LogoutModal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ export default {
logout() {
this.$store.dispatch('clearWallet');
this.$refs.logout.hide();
this.$router.push('/');
},
cancel() {
this.$refs.logout.hide();
Expand Down
5 changes: 5 additions & 0 deletions src/components/LogoutWarningModal/LogoutWarningModal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,12 @@ export default {
},
methods: {
logout() {
const path = this.$route.fullPath;
if (path !== '/interface') {
this.$store.dispatch('setLastPath', path);
}
this.$store.dispatch('clearWallet');
this.$store.dispatch('setLastPath', '');
this.$refs.logoutWarningModal.hide();
},
cancel() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -196,8 +196,8 @@ export default {
if (store.get('localTokens') !== undefined) {
this.getV3Tokens();
}
const storedTokens = store.get('customTokens');
this.customTokens = storedTokens.hasOWnProperty(this.network.type.name)
const storedTokens = store.get('customTokens') || {};
this.customTokens = storedTokens.hasOwnProperty(this.network.type.name)
? storedTokens[this.network.type.name]
: [];
},
Expand Down
3 changes: 2 additions & 1 deletion src/store/actions.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,10 +77,11 @@ const gettingStartedDone = function({ commit }) {
};

const clearWallet = function({ commit, state }) {
const linkTo = state.path !== '' ? state.path : '/';
if (state.wallet && state.wallet.identifier === MEW_CONNECT) {
state.wallet.mewConnect().disconnectRTC();
}
Vue.router.push('/');
Vue.router.push(linkTo);
commit('CLEAR_WALLET');
};

Expand Down