Skip to content
This repository was archived by the owner on Jan 26, 2024. It is now read-only.

Commit cdc5b23

Browse files
committed
Cache can not be local to storage LocalForage class at is instantiated in many other places and should be shared among all the instances
1 parent 7960897 commit cdc5b23

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

core/store/lib/storage.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -25,19 +25,19 @@ class LocalForageCacheDriver {
2525
if (typeof this.cacheErrorsCount[collectionName] === 'undefined') {
2626
this.cacheErrorsCount[collectionName] = 0
2727
}
28-
if (typeof this.localCache === 'undefined') {
29-
this.localCache = {}
28+
if (typeof Vue.prototype.$localCache === 'undefined') {
29+
Vue.prototype.$localCache = {}
3030
}
31-
if (typeof this.localCache[dbName] === 'undefined') {
32-
this.localCache[dbName] = {}
31+
if (typeof Vue.prototype.$localCache[dbName] === 'undefined') {
32+
Vue.prototype.$localCache[dbName] = {}
3333
}
34-
if (typeof this.localCache[dbName][collectionName] === 'undefined') {
35-
this.localCache[dbName][collectionName] = {}
34+
if (typeof Vue.prototype.$localCache[dbName][collectionName] === 'undefined') {
35+
Vue.prototype.$localCache[dbName][collectionName] = {}
3636
}
3737
this._collectionName = collectionName
3838
this._dbName = dbName
3939
this._useLocalCacheByDefault = useLocalCacheByDefault
40-
this._localCache = this.localCache[dbName][collectionName]
40+
this._localCache = Vue.prototype.$localCache[dbName][collectionName]
4141
this._localForageCollection = collection
4242
this._lastError = null
4343
this._persistenceErrorNotified = false

0 commit comments

Comments
 (0)