Add network namespace for browser cache

We want to be able to cache data from multiple networks side-by-side,
without them interfering with each other.
This commit is contained in:
2020-05-28 11:53:19 +02:00
parent 832de3c06f
commit e7c9620bbe
2 changed files with 5 additions and 3 deletions
+3 -1
View File
@@ -1,8 +1,10 @@
import Service from '@ember/service';
import * as localforage from 'localforage';
import config from 'kredits-web/config/environment';
function createStore(name) {
return localforage.createInstance({ name: `kredits:${name}` });
const networkName = config.web3RequiredNetwork || 'custom';
return localforage.createInstance({ name: `kredits:${networkName}:${name}` });
}
export default class BrowserCacheService extends Service {