Commit b1b0ee71c45997c433aba9eaf0175aa177983a29
Merge branch 'osx-update-badge' of https://github.com/dmamills/patchwork
Matt McKegg committed on 6/1/2017, 12:37:05 AMParent: 76c71c64adb968557a0b0f4a8f320fd824454b2d
Parent: 3a821842c26b02423fe8a54d5e2ef9c91c0ecd14
Files changed
main-window.js | changed |
main-window.js | ||
---|---|---|
@@ -10,9 +10,11 @@ | ||
10 | 10 … | var nest = require('depnest') |
11 | 11 … | var LatestUpdate = require('./lib/latest-update') |
12 | 12 … | var ref = require('ssb-ref') |
13 | 13 … | var setupContextMenuAndSpellCheck = require('./lib/context-menu-and-spellcheck') |
14 … | +var watch = require('mutant/watch') | |
14 | 15 … | |
16 … | + | |
15 | 17 … | module.exports = function (config) { |
16 | 18 … | var sockets = combine( |
17 | 19 … | overrideConfig(config), |
18 | 20 … | addCommand('app.navigate', setView), |
@@ -55,8 +57,20 @@ | ||
55 | 57 … | var views = api.app.views(api.page.html.render, [ |
56 | 58 … | '/public', '/private', id, '/mentions' |
57 | 59 … | ]) |
58 | 60 … | |
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 … | + | |
59 | 73 … | insertCss(require('./styles')) |
60 | 74 … | |
61 | 75 … | var container = h(`MainWindow -${process.platform}`, [ |
62 | 76 … | h('div.top', [ |
Built with git-ssb-web