Ask questionsWebstore instance lost on page refresh

I'm using vue js 2. I have a main file with this code:

 import Vue from 'vue'
 import App from './App.vue'
 import router from './router'

const Store = require('secure-webstore').Store

const store = new Store('user_data', 'lachiquichiqui89')

store.init().then(() => {
  // store is ready

Vue.prototype.$store = store

new Vue({
  render: h => h(App)

This is working fine...I already store some data in indexeddb....but when I refresh the page, I think maybe the instance is lost, because I'm getting this error trying to get the store object inside a component:

Error: Master key not initialized
at Store.get key [as key] (secure-webstore.js?ee28:31)
at Store.eval (secure-webstore.js?ee28:87)
at (<anonymous>)
at fulfilled (secure-webstore.js?ee28:4)

And data it's ok!!, so I don't know how to solve it...please help! cap


Answer questions Master-Y0da

@deiu Solved!!...I just add a setTimeOut function and wait by 2 seconds...and now it's working...However would be nice if this kind of issues could be considered at next release. Thanks for your time and help!!


Related questions

No questions were found.
Github User Rank List