aboutsummaryrefslogtreecommitdiff
path: root/ext/bg/js/options.js
diff options
context:
space:
mode:
authortoasted-nutbread <toasted-nutbread@users.noreply.github.com>2019-09-05 19:56:29 -0400
committertoasted-nutbread <toasted-nutbread@users.noreply.github.com>2019-09-05 20:57:52 -0400
commit5ddbb0373f93632109458725e0f18f1fc75ff643 (patch)
tree7f18411b1285b523e141b00168828ed5485ef100 /ext/bg/js/options.js
parentec110fa1b7299a947ea3eabc0e2c46094408c8ba (diff)
Add function to create default options
Diffstat (limited to 'ext/bg/js/options.js')
-rw-r--r--ext/bg/js/options.js8
1 files changed, 6 insertions, 2 deletions
diff --git a/ext/bg/js/options.js b/ext/bg/js/options.js
index 976f8e55..be27f71f 100644
--- a/ext/bg/js/options.js
+++ b/ext/bg/js/options.js
@@ -183,8 +183,8 @@ function optionsFieldTemplates() {
`.trim();
}
-function optionsSetDefaults(options) {
- const defaults = {
+function optionsCreateDefaults() {
+ return {
general: {
enable: true,
audioSource: 'jpod101',
@@ -238,6 +238,10 @@ function optionsSetDefaults(options) {
fieldTemplates: optionsFieldTemplates()
}
};
+}
+
+function optionsSetDefaults(options) {
+ const defaults = optionsCreateDefaults();
const combine = (target, source) => {
for (const key in source) {