diff options
author | 2022-10-22 15:43:38 +0530 | |
---|---|---|
committer | 2022-10-22 10:13:38 +0000 | |
commit | 8870f43b9c04a429b2071f3284e898bda478d74b (patch) | |
tree | 2856ee99374048a26af5899aff89cf40ffa514a3 /src/models/Service.ts | |
parent | 6.2.1-nightly.25 [skip ci] (diff) | |
download | ferdium-app-8870f43b9c04a429b2071f3284e898bda478d74b.tar.gz ferdium-app-8870f43b9c04a429b2071f3284e898bda478d74b.tar.zst ferdium-app-8870f43b9c04a429b2071f3284e898bda478d74b.zip |
Add service-level option 'isMediaBadgeEnabled' defaulted to false (#688)
Diffstat (limited to 'src/models/Service.ts')
-rw-r--r-- | src/models/Service.ts | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/models/Service.ts b/src/models/Service.ts index f33d30695..e45909631 100644 --- a/src/models/Service.ts +++ b/src/models/Service.ts | |||
@@ -8,7 +8,7 @@ import ElectronWebView from 'react-electron-web-view'; | |||
8 | import { todosStore } from '../features/todos'; | 8 | import { todosStore } from '../features/todos'; |
9 | import { isValidExternalURL } from '../helpers/url-helpers'; | 9 | import { isValidExternalURL } from '../helpers/url-helpers'; |
10 | import UserAgent from './UserAgent'; | 10 | import UserAgent from './UserAgent'; |
11 | import { DEFAULT_SERVICE_ORDER } from '../config'; | 11 | import { DEFAULT_SERVICE_ORDER, DEFAULT_SERVICE_SETTINGS } from '../config'; |
12 | import { ifUndefined } from '../jsUtils'; | 12 | import { ifUndefined } from '../jsUtils'; |
13 | import { IRecipe } from './Recipe'; | 13 | import { IRecipe } from './Recipe'; |
14 | import { needsToken } from '../api/apiBase'; | 14 | import { needsToken } from '../api/apiBase'; |
@@ -59,6 +59,9 @@ export default class Service { | |||
59 | 59 | ||
60 | @observable isBadgeEnabled: boolean = true; | 60 | @observable isBadgeEnabled: boolean = true; |
61 | 61 | ||
62 | @observable isMediaBadgeEnabled: boolean = | ||
63 | DEFAULT_SERVICE_SETTINGS.isMediaBadgeEnabled; | ||
64 | |||
62 | @observable trapLinkClicks: boolean = false; | 65 | @observable trapLinkClicks: boolean = false; |
63 | 66 | ||
64 | @observable isIndirectMessageBadgeEnabled: boolean = true; | 67 | @observable isIndirectMessageBadgeEnabled: boolean = true; |
@@ -169,6 +172,11 @@ export default class Service { | |||
169 | data.isBadgeEnabled, | 172 | data.isBadgeEnabled, |
170 | this.isBadgeEnabled, | 173 | this.isBadgeEnabled, |
171 | ); | 174 | ); |
175 | |||
176 | this.isMediaBadgeEnabled = ifUndefined<boolean>( | ||
177 | data.isMediaBadgeEnabled, | ||
178 | this.isMediaBadgeEnabled, | ||
179 | ); | ||
172 | this.trapLinkClicks = ifUndefined<boolean>( | 180 | this.trapLinkClicks = ifUndefined<boolean>( |
173 | data.trapLinkClicks, | 181 | data.trapLinkClicks, |
174 | this.trapLinkClicks, | 182 | this.trapLinkClicks, |