git ssb

16+

Dominic / patchbay



Tree: 5b17ba2a85122774945850eeb89c50eaded5c446

Files: 5b17ba2a85122774945850eeb89c50eaded5c446 / app / html / settings / tor-only.js

944 bytesRaw
1const nest = require('depnest')
2const { h } = require('mutant')
3
4exports.gives = nest({
5 'app.html.settings': true
6})
7
8exports.needs = nest({
9 'app.html.settings': 'map',
10 'settings.obs.get': 'first',
11 'settings.sync.set': 'first'
12})
13
14exports.create = function (api) {
15 return nest({
16 'app.html.settings': torOnly
17 })
18
19 function torOnly () {
20 const torOnly = api.settings.obs.get('patchbay.torOnly', false)
21 const toggleTorOnly = (ev) => {
22 api.settings.sync.set({patchbay: {torOnly: ev.target.checked}})
23
24 alert("please restart patchbay for this to take effect")
25 }
26
27 return {
28 title: 'Tor only connections',
29 body: h('DefaultTabs', [
30 h('p', [
31 'Preserve your ip privacy by only connecting to other nodes using tor',
32 h('input', {
33 type: 'checkbox',
34 checked: torOnly,
35 'ev-change': toggleTorOnly
36 })
37 ])
38 ])
39 }
40 }
41}
42

Built with git-ssb-web