Files: 9ad609d054fd59c134b3aac1b801d0aa7d8d0e5a / app / sync / initialise / settings.js
867 bytesRaw
1 | const nest = require('depnest') |
2 | const merge = require('lodash/merge') |
3 | |
4 | exports.gives = nest('app.sync.initialise') |
5 | |
6 | exports.needs = nest({ |
7 | 'settings.sync.set': 'first', |
8 | 'settings.sync.get': 'first' |
9 | }) |
10 | |
11 | const 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 | |
34 | exports.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