feat(mobx): migrate audio settings

This commit is contained in:
Paul Makles
2021-12-16 22:05:31 +00:00
parent c7df0088fc
commit 120e6a35d8
13 changed files with 147 additions and 188 deletions

View File

@@ -4,17 +4,13 @@ import { mapToRecord } from "../../lib/conversion";
import { Fonts, MonospaceFonts, Overrides } from "../../context/Theme";
import { Sounds } from "../../assets/sounds/Audio";
import { EmojiPack } from "../../components/common/Emoji";
import Persistent from "../interfaces/Persistent";
import Store from "../interfaces/Store";
import SAudio, { SoundOptions } from "./helpers/SAudio";
import STheme from "./helpers/STheme";
export type SoundOptions = {
[key in Sounds]?: boolean;
};
export type EmojiPack = "mutant" | "twemoji" | "noto" | "openmoji";
interface ISettings {
"notifications:desktop": boolean;
"notifications:sounds": SoundOptions;
@@ -37,6 +33,7 @@ export default class Settings implements Store, Persistent<ISettings> {
private data: ObservableMap<string, unknown>;
theme: STheme;
sounds: SAudio;
/**
* Construct new Settings store.
@@ -46,6 +43,7 @@ export default class Settings implements Store, Persistent<ISettings> {
makeAutoObservable(this);
this.theme = new STheme(this);
this.sounds = new SAudio(this);
}
get id() {