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

fix broken scrolling after signup/in #216

Merged
merged 2 commits into from
Dec 9, 2017
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
5 changes: 0 additions & 5 deletions app/src/renderer/components/common/NiSession.vue
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@

<script>
import {mapGetters} from 'vuex'
import noScroll from 'no-scroll'
import SessionWelcome from 'common/NiSessionWelcome'
import SessionSignUp from 'common/NiSessionSignUp'
import SessionSignIn from 'common/NiSessionSignIn'
Expand All @@ -32,11 +31,7 @@ export default {
...mapGetters(['config', 'config']),
active () { return this.config.modals.session.active }
},
mounted () {
noScroll.on()
},
beforeDestroy () {
noScroll.off()
if (!this.config.devMode) {
this.$store.commit('setModalSession', true)
}
Expand Down
9 changes: 8 additions & 1 deletion app/src/renderer/vuex/modules/config.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import noScroll from 'no-scroll'

export default ({ commit, basecoin }) => {
const state = {
activeMenu: '',
Expand All @@ -22,7 +24,12 @@ export default ({ commit, basecoin }) => {
},
setModalSession (state, value) {
// reset modal session state if we're closing the modal
if (!value) { state.modals.session.state = 'welcome' }
if (value) {
noScroll.on()
} else {
state.modals.session.state = 'welcome'
noScroll.off()
}
state.modals.session.active = value
},
setModalSessionState (state, value) {
Expand Down