git ssb

16+

Dominic / patchbay



Tree: fd0e5304bd3777aa0d1bedb42467e378508b89cd

Files: fd0e5304bd3777aa0d1bedb42467e378508b89cd / app / sync / initialise / settings.js

867 bytesRaw
1const nest = require('depnest')
2const merge = require('lodash/merge')
3
4exports.gives = nest('app.sync.initialise')
5
6exports.needs = nest({
7 'settings.sync.set': 'first',
8 'settings.sync.get': 'first'
9})
10
11const defaults = {
12 patchbay: {
13 defaultTabs: ['/public', '/inbox', '/notifications']
14 },
15 filter: {
16 exclude: {
17 channels: ''
18 },
19 only: {
20 peopleIFollow: false
21 },
22 show: {
23 post: true,
24 vote: false, // a.k.a. like
25 about: true,
26 contact: false,
27 channel: false,
28 pub: false,
29 chess: false
30 }
31 }
32}
33
34exports.create = function (api) {
35 return nest('app.sync.initialise', initialiseSettings)
36
37 function initialiseSettings () {
38 const { get, set } = api.settings.sync
39 const settings = merge({}, defaults, get())
40 settings.filter.defaults = defaults.filter
41
42 set(settings)
43 }
44}
45

Built with git-ssb-web