forked from Yadro/time-tracker
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSettingsModel.ts
More file actions
30 lines (27 loc) · 931 Bytes
/
SettingsModel.ts
File metadata and controls
30 lines (27 loc) · 931 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
import AbstractModel from '../../../base/AbstractModel';
import { makeObservable, observable } from 'mobx';
export const DEFAULT_SETTINGS = {
currentProfile: 'profile1',
profiles: ['profile1'],
numberOfWorkingHours: 8 * 60 * 60 * 1000,
isFirstLoad: true,
showNotifications: true,
};
export default class SettingsModel extends AbstractModel {
currentProfile: string = DEFAULT_SETTINGS.currentProfile;
profiles: string[] = DEFAULT_SETTINGS.profiles;
numberOfWorkingHours: number = DEFAULT_SETTINGS.numberOfWorkingHours;
isFirstLoad: boolean = DEFAULT_SETTINGS.isFirstLoad;
showNotifications: boolean = DEFAULT_SETTINGS.showNotifications;
constructor(data: any) {
super();
this.load(data);
makeObservable(this, {
currentProfile: observable,
profiles: observable,
numberOfWorkingHours: observable,
isFirstLoad: observable,
showNotifications: observable,
});
}
}