From 19ef0c756eba1b6c554ce9892f503534e2bf0597 Mon Sep 17 00:00:00 2001 From: Vijay A Date: Sat, 16 Oct 2021 21:43:20 +0530 Subject: refactor: move service-defaults into the 'config' file for reuse --- src/stores/ServicesStore.js | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) (limited to 'src/stores') diff --git a/src/stores/ServicesStore.js b/src/stores/ServicesStore.js index c6baa4358..4f7ad7442 100644 --- a/src/stores/ServicesStore.js +++ b/src/stores/ServicesStore.js @@ -15,7 +15,7 @@ import { getDevRecipeDirectory, } from '../helpers/recipe-helpers'; import { workspaceStore } from '../features/workspaces'; -import { KEEP_WS_LOADED_USID } from '../config'; +import { DEFAULT_SERVICE_SETTINGS, KEEP_WS_LOADED_USID } from '../config'; import { SPELLCHECKER_LOCALES } from '../i18n/languages'; import { ferdiVersion } from '../environment-remote'; @@ -395,17 +395,15 @@ export default class ServicesStore extends Store { } // set default values for serviceData - - // TODO: How is this different from the defaults of the recipe in 'src/models/Recipe' file? serviceData = { - isEnabled: true, - isHibernationEnabled: false, - isWakeUpEnabled: true, - isNotificationEnabled: true, - isBadgeEnabled: true, - isMuted: false, - customIcon: false, - isDarkModeEnabled: false, + isEnabled: DEFAULT_SERVICE_SETTINGS.isEnabled, + isHibernationEnabled: DEFAULT_SERVICE_SETTINGS.isHibernationEnabled, + isWakeUpEnabled: DEFAULT_SERVICE_SETTINGS.isWakeUpEnabled, + isNotificationEnabled: DEFAULT_SERVICE_SETTINGS.isNotificationEnabled, + isBadgeEnabled: DEFAULT_SERVICE_SETTINGS.isBadgeEnabled, + isMuted: DEFAULT_SERVICE_SETTINGS.isMuted, + customIcon: DEFAULT_SERVICE_SETTINGS.customIcon, + isDarkModeEnabled: DEFAULT_SERVICE_SETTINGS.isDarkModeEnabled, spellcheckerLanguage: SPELLCHECKER_LOCALES[this.stores.settings.app.spellcheckerLanguage], userAgentPref: '', -- cgit v1.2.3-54-g00ecf