Добавлена возможность загружать пользовательские обои, пока без синхронизации
This commit is contained in:
27
client/components/Reader/share/wallpaperStorage.js
Normal file
27
client/components/Reader/share/wallpaperStorage.js
Normal file
@@ -0,0 +1,27 @@
|
||||
import localForage from 'localforage';
|
||||
//import _ from 'lodash';
|
||||
|
||||
const wpStore = localForage.createInstance({
|
||||
name: 'wallpaperStorage'
|
||||
});
|
||||
|
||||
class WallpaperStorage {
|
||||
|
||||
async getLength() {
|
||||
return await wpStore.length();
|
||||
}
|
||||
|
||||
async setData(key, data) {
|
||||
await wpStore.setItem(key, data);
|
||||
}
|
||||
|
||||
async getData(key) {
|
||||
return await wpStore.getItem(key);
|
||||
}
|
||||
|
||||
async removeData(key) {
|
||||
await wpStore.removeItem(key);
|
||||
}
|
||||
}
|
||||
|
||||
export default new WallpaperStorage();
|
||||
Reference in New Issue
Block a user