git ssb

16+

Dominic / patchbay



Commit 9ebbbea9829c7cc67a7fd3e50d57216f25b6a4fb

Rename mentions to notifications

Piet Geursen committed on 3/17/2017, 2:12:37 AM
Parent: c2dcf64996a3dccefa598cd0ab5f6c2bc849d57d

Files changed

main/html/app.jschanged
router/html/page/mentions.jsdeleted
router/html/page/notifications.jsadded
main/html/app.jsView
@@ -28,9 +28,9 @@
2828
2929 page.id = page.id || link
3030 tabs.add(page, change, split)
3131 }
32- const initialTabs = ['/public', '/private', '/mentions']
32+ const initialTabs = ['/public', '/private', '/notifications']
3333 initialTabs.forEach(r => addPage(r))
3434 tabs.select(0)
3535
3636 catchClick(App, (link, { ctrlKey: openBackground, isExternal }) => {
router/html/page/mentions.jsView
@@ -1,36 +1,0 @@
1-const nest = require('depnest')
2-const pull = require('pull-stream')
3-const Scroller = require('pull-scroll')
4-const next = require('../../../junk/next-stepper')
5-
6-exports.gives = nest('router.html.page')
7-exports.needs = nest({
8- 'keys.sync.id': 'first',
9- 'feed.pull.mentions': 'first',
10- 'feed.pull.public': 'first',
11- 'message.html': {
12- render: 'first'
13- },
14- 'main.html.scroller': 'first'
15-})
16-exports.create = function (api) {
17- return nest('router.html.page', (path) => {
18- if (path !== '/mentions') return
19- const id = api.keys.sync.id()
20- const mentions = api.feed.pull.mentions(id)
21-
22- const { container, content } = api.main.html.scroller({})
23-
24- pull(
25- next(mentions, {old: false, limit: 100}),
26- Scroller(container, content, api.message.html.render, true, false)
27- )
28-
29- pull(
30- next(mentions, {reverse: true, limit: 100, live: false}),
31- Scroller(container, content, api.message.html.render, false, false)
32- )
33- return container
34- })
35-}
36-
router/html/page/notifications.jsView
@@ -1,0 +1,36 @@
1+const nest = require('depnest')
2+const pull = require('pull-stream')
3+const Scroller = require('pull-scroll')
4+const next = require('../../../junk/next-stepper')
5+
6+exports.gives = nest('router.html.page')
7+exports.needs = nest({
8+ 'keys.sync.id': 'first',
9+ 'feed.pull.mentions': 'first',
10+ 'feed.pull.public': 'first',
11+ 'message.html': {
12+ render: 'first'
13+ },
14+ 'main.html.scroller': 'first'
15+})
16+exports.create = function (api) {
17+ return nest('router.html.page', (path) => {
18+ if (path !== '/notifications') return
19+ const id = api.keys.sync.id()
20+ const mentions = api.feed.pull.mentions(id)
21+
22+ const { container, content } = api.main.html.scroller({})
23+
24+ pull(
25+ next(mentions, {old: false, limit: 100}),
26+ Scroller(container, content, api.message.html.render, true, false)
27+ )
28+
29+ pull(
30+ next(mentions, {reverse: true, limit: 100, live: false}),
31+ Scroller(container, content, api.message.html.render, false, false)
32+ )
33+ return container
34+ })
35+}
36+

Built with git-ssb-web