git ssb

10+

Matt McKegg / patchwork



Commit b1b0ee71c45997c433aba9eaf0175aa177983a29

Merge branch 'osx-update-badge' of https://github.com/dmamills/patchwork

Matt McKegg committed on 6/1/2017, 12:37:05 AM
Parent: 76c71c64adb968557a0b0f4a8f320fd824454b2d
Parent: 3a821842c26b02423fe8a54d5e2ef9c91c0ecd14

Files changed

main-window.jschanged
main-window.jsView
@@ -10,9 +10,11 @@
1010 var nest = require('depnest')
1111 var LatestUpdate = require('./lib/latest-update')
1212 var ref = require('ssb-ref')
1313 var setupContextMenuAndSpellCheck = require('./lib/context-menu-and-spellcheck')
14 +var watch = require('mutant/watch')
1415
16 +
1517 module.exports = function (config) {
1618 var sockets = combine(
1719 overrideConfig(config),
1820 addCommand('app.navigate', setView),
@@ -55,8 +57,20 @@
5557 var views = api.app.views(api.page.html.render, [
5658 '/public', '/private', id, '/mentions'
5759 ])
5860
61 + var pendingCount = computed([
62 + views.get('/public').pendingUpdates,
63 + views.get('/private').pendingUpdates
64 + ], (...counts) => {
65 + return counts.reduce((a, b) => a + b)
66 + })
67 +
68 + watch(pendingCount, count => {
69 + electron.remote.app.setBadgeCount(count)
70 + })
71 +
72 +
5973 insertCss(require('./styles'))
6074
6175 var container = h(`MainWindow -${process.platform}`, [
6276 h('div.top', [

Built with git-ssb-web