Skip to content

Commit

Permalink
Merge pull request #216 from cosmos/peng/213-fix-scrolling-after-sigi…
Browse files Browse the repository at this point in the history
…ning-in

fix broken scrolling after signup/in
  • Loading branch information
jbibla authored Dec 9, 2017
2 parents 8e889fd + f43d63c commit d6356f5
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
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

0 comments on commit d6356f5

Please sign in to comment.