git ssb

16+

Dominic / patchbay



Commit a4b0a6f9c734c9e1b63226cf6c9babf790be3048

Merge branch 'master' of github.com:ssbc/patchbay into posts_rollup

mixmix committed on 7/9/2018, 2:07:46 AM
Parent: 920f29c78bb0076a529cda4bbc4f01b19cabd924
Parent: 625f7819b686f7a94242c8ea945e8b013dbbed7b

Files changed

about/html/edit.jschanged
background-process.jschanged
index.jschanged
package.jsonchanged
about/html/edit.jsView
@@ -2,15 +2,14 @@
22 const dataurl = require('dataurl-')
33 const hyperfile = require('hyperfile')
44 const hypercrop = require('hypercrop')
55 const hyperlightbox = require('hyperlightbox')
6-const Mutual = require('ssb-mutual')
7-
86 const {
9- h, Value, Dict: MutantObject, Struct,
10- map, computed, when, dictToCollection
7 + h, Value, Dict, Struct,
8 + map, computed, when, dictToCollection, onceTrue
119 } = require('mutant')
1210 const pull = require('pull-stream')
11 +const Mutual = require('ssb-mutual')
1312
1413 exports.gives = nest('about.html.edit')
1514
1615 exports.needs = nest({
@@ -38,13 +37,12 @@
3837
3938 // TODO refactor this to use obs better
4039 function edit (id) {
4140 // TODO - get this to wait till the connection is present !
42- var mutual = Mutual.init(api.sbot.obs.connection())
4341
4442 var avatar = Struct({
4543 current: api.about.obs.imageUrl(id),
46- new: MutantObject()
44 + new: Dict()
4745 })
4846
4947 const links = api.sbot.pull.links
5048
@@ -54,9 +52,9 @@
5452 })
5553
5654 const images = computed(api.about.obs.groupedValues(id, 'image'), Object.keys)
5755
58- var namesRecord = MutantObject()
56 + var namesRecord = Dict()
5957 // TODO constrain query to one name per peer?
6058 pull(
6159 links({dest: id, rel: 'about', values: true}),
6260 pull.map(e => e.value.content.name),
@@ -83,18 +81,17 @@
8381 if (name.new) return name.new
8482 else return name.current
8583 })
8684
87- var balances_div = h('div.balances')
85 + var balances = Dict()
86 + onceTrue(api.sbot.obs.connection, sbot => {
87 + if (!sbot.links) throw new Error('where ma sbot.links at?!')
88 + var mutual = Mutual.init(sbot)
89 + mutual.getAccountBalances(id, (err, data) => {
90 + if (err) console.log(err)
91 + if (data == null) return
8892
89- mutual.getAccountBalances(id, (error, balances) => {
90- if (balances == null) return ''
91-
92- var balance_els = []
93- Object.keys(balances).forEach(function (key) {
94- balances_div.appendChild(
95- h('div', `💰 ${balances[key]} ${key}`)
96- )
93 + balances.set(data)
9794 })
9895 })
9996
10097 return h('AboutEditor', [
@@ -108,9 +105,11 @@
108105 h('section.description', computed(api.about.obs.description(id), (descr) => {
109106 if (descr == null) return '' // TODO: should be in patchcore, I think...
110107 return api.message.html.markdown(descr)
111108 })),
112- h('section.credit', balances_div),
109 + h('section.credit', map(dictToCollection(balances), balance => {
110 + return h('div', ['💰 ', balance.value, ' ', balance.key])
111 + })),
113112 h('section.aliases', [
114113 h('header', 'Aliases'),
115114 h('section.avatars', [
116115 h('header', 'Avatars'),
background-process.jsView
@@ -12,17 +12,18 @@
1212 .use(require('scuttlebot/plugins/local'))
1313 .use(require('scuttlebot/plugins/logging'))
1414 .use(require('ssb-about'))
1515 .use(require('ssb-backlinks'))
16 + .use(require('ssb-blobs'))
17 + .use(require('ssb-chess-db'))
18 + .use(require('ssb-ebt'))
1619 .use(require('ssb-friends'))
20 + .use(require('ssb-meme'))
1721 .use(require('ssb-private'))
18- .use(require('ssb-blobs'))
22 + .use(require('ssb-query'))
1923 .use(require('ssb-search'))
20- .use(require('ssb-meme'))
21- .use(require('ssb-ebt'))
22- .use(require('ssb-chess-db'))
23- .use(require('ssb-query'))
2424 .use(require('ssb-ws'))
25 + // .use(require('ssb-mutual')) // this is has recursion problems atm
2526
2627 // pull config options out of depject
2728 var config = require('./config').create().config.sync.load()
2829
index.jsView
@@ -107,8 +107,10 @@
107107 width: windowState.width,
108108 height: windowState.height,
109109 autoHideMenuBar: true,
110110 title: 'Patchbay',
111 + frame: !process.env.FRAME,
112 + // titleBarStyle: 'hidden',
111113 show: true,
112114 backgroundColor: '#FFF',
113115 icon: './assets/icon.png'
114116 })
package.jsonView
@@ -6,8 +6,9 @@
66 "scripts": {
77 "lint": "standard",
88 "rebuild": "cross-script npm rebuild --runtime=electron \"--target=$(electron -v)\" \"--abi=$(electron --abi)\" --disturl=https://atom.io/download/atom-shell",
99 "start": "electron index.js -- --title patchbay",
10 + "start-frameless": "FRAME=false npm start",
1011 "dev": "echo 'run your own sbot!' && electro main.js -- --title patchbay --icon ./assets/icon.png"
1112 },
1213 "browserify": {
1314 "transform": [
@@ -22,8 +23,9 @@
2223 "url": "git+https://github.com/ssbc/patchbay.git"
2324 },
2425 "author": "mixmix",
2526 "maintainers": [
27 + "arj03",
2628 "ahdinosaur",
2729 "cel",
2830 "dominictarr",
2931 "mmckegg"

Built with git-ssb-web