aboutsummaryrefslogtreecommitdiff
path: root/src/background/repositories
diff options
context:
space:
mode:
authorShin'ya UEOKA <ueokande@i-beam.org>2019-10-04 04:01:35 +0000
committerShin'ya UEOKA <ueokande@i-beam.org>2019-10-06 12:58:59 +0000
commit410ffbb0376b9399928ef8d4dd13079bfb120e14 (patch)
treee408870fb867c7affb04c9b0130463df24e9f097 /src/background/repositories
parentb496cea5827165bd23a503231f94f708a976cad4 (diff)
Make Keymap class
Diffstat (limited to 'src/background/repositories')
-rw-r--r--src/background/repositories/SettingRepository.ts8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/background/repositories/SettingRepository.ts b/src/background/repositories/SettingRepository.ts
index 2f159e5..c7a0e84 100644
--- a/src/background/repositories/SettingRepository.ts
+++ b/src/background/repositories/SettingRepository.ts
@@ -1,6 +1,6 @@
import { injectable } from 'tsyringe';
import MemoryStorage from '../infrastructures/MemoryStorage';
-import Settings from '../../shared/Settings';
+import Settings, { valueOf, toJSON } from '../../shared/Settings';
import * as PropertyDefs from '../../shared/property-defs';
const CACHED_SETTING_KEY = 'setting';
@@ -14,11 +14,13 @@ export default class SettingRepository {
}
get(): Promise<Settings> {
- return Promise.resolve(this.cache.get(CACHED_SETTING_KEY));
+ let data = this.cache.get(CACHED_SETTING_KEY);
+ return Promise.resolve(valueOf(data));
}
update(value: Settings): void {
- return this.cache.set(CACHED_SETTING_KEY, value);
+ let data = toJSON(value);
+ return this.cache.set(CACHED_SETTING_KEY, data);
}
async setProperty(