git ssb

2+

mixmix / ticktack



Tree: ca44a0a40e4d24c2b6b42467fac6072170073817

Files: ca44a0a40e4d24c2b6b42467fac6072170073817 / app / sync / initialize / settings.js

683 bytesRaw
1const nest = require('depnest')
2const merge = require('lodash/merge')
3
4exports.gives = nest('app.sync.initialize')
5
6exports.needs = nest({
7 'settings.sync.set': 'first',
8 'settings.sync.get': 'first'
9})
10
11const defaults = {
12 onboarded: false,
13 language: 'en',
14 ticktack: {
15 websharemetrics: 'public',
16 electron: {
17 zoomFactor: 1
18 }
19 }
20}
21
22exports.create = function (api) {
23 return nest('app.sync.initialize', initialiseSettings)
24
25 function initialiseSettings () {
26 console.log('> initialise: default settings')
27 const { get, set } = api.settings.sync
28 const settings = merge({}, defaults, get())
29
30 console.log('dog', settings)
31 set(settings)
32 }
33}
34

Built with git-ssb-web