Closed sankar-ganesh closed 6 years ago
This needs more clarification. Show me something of your code. What Ember version are you on? What version of the adapter?
Ember Version : 2.4.1
This is the adapter
import Ember from 'ember';
import LFAdapter from 'ember-localforage-adapter/adapters/localforage';
const {
computed,
inject
} = Ember;
export default LFAdapter.extend({
session: inject.service('session'),
namespace: computed('session.appId', {
get: function() {
var appId = this.get('session.appId');
return appId && appId.toString();
}
}),
caching: 'all'
});
In route I am doing this
model: function() {
return this.store.findAll("datastore");
},
afterModel: function(model) {
var session = this.get('session.appId'),
datastore = model && model.findBy("appId", appId);
if (datastore) {
// data available
} else {
// load datastore
datastore = this.store.createRecord('datastore', {
appId: appId,
messages: Ember.A([])
});
return datastore.save();
}
}
What if you add localforage to your bower.json with version 1.5.0? Maybe there is a bug fixed for safari.
If so, we could update this package to reference a newer localforage version.
works like a champ :-) thanks!!!
shall we continue pointing to 1.5.0?
Yeah, if you could create a PR with the new version, that would be great.
Locaforage updated to latest version, closed.
On initial load or when user come back after clearing the local store we see init problem only in web safari browser.
On init we are trying to set default values into the indexDB. Appreciate your help!!! Thanks
PS: No error in browser console