Persist current room
This commit is contained in:
parent
43b3bdf164
commit
99a6b1e989
1 changed files with 10 additions and 0 deletions
|
|
@ -1,10 +1,19 @@
|
|||
import Vue from 'vue'
|
||||
import Vuex from 'vuex'
|
||||
import VuexPersist from 'vuex-persist'
|
||||
|
||||
import { auth } from './auth.module';
|
||||
|
||||
Vue.use(Vuex)
|
||||
|
||||
const vuexPersist = new VuexPersist({
|
||||
key: 'settings',
|
||||
storage: localStorage,
|
||||
reducer: state => ({
|
||||
currentRoomId: state.currentRoomId
|
||||
})
|
||||
})
|
||||
|
||||
export default new Vuex.Store({
|
||||
state: {
|
||||
currentRoomId: null
|
||||
|
|
@ -19,4 +28,5 @@ export default new Vuex.Store({
|
|||
modules: {
|
||||
auth
|
||||
},
|
||||
plugins: [vuexPersist.plugin]
|
||||
})
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue