ssb-chess-mithril 2.1.2 → 2.1.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/index.js CHANGED
@@ -61,6 +61,8 @@ module.exports = (attachToElement, dataAccess, opts = {}) => {
61
61
  const gamesMyMoveObs = mainCtrl.getGameCtrl().getGamesWhereMyMove();
62
62
  const observableGamesObs = mainCtrl.getGameCtrl().getFriendsObservableGames();
63
63
  const userRecentActivity = mainCtrl.getRecentActivityCtrl().getRecentActivityForUserGames();
64
+ const pendingChallengesReceived = mainCtrl.getInviteCtrl().pendingChallengesReceived()
65
+ const unseenNotifications = mainCtrl.getRecentActivityCtrl().unseenNotifications()
64
66
 
65
67
  // Hack: keep observables loaded with the latest value.
66
68
  const watches = [
@@ -74,7 +76,12 @@ module.exports = (attachToElement, dataAccess, opts = {}) => {
74
76
 
75
77
  m.route.prefix = '?';
76
78
 
77
- const navigationBar = NavigationBar(mainCtrl, settingsCtrl)
79
+ const navigationBar = NavigationBar(mainCtrl, settingsCtrl, {
80
+ gamesWhereMyMove: gamesMyMoveObs,
81
+ friendsObservableGames: observableGamesObs,
82
+ pendingChallengesReceived: pendingChallengesReceived,
83
+ unseenNotifications: unseenNotifications
84
+ })
78
85
 
79
86
  m.route(mountElement, defaultView, {
80
87
  '/my_games': layoutTemplate(navigationBar, MiniboardListComponent(mainCtrl, gamesInProgressObs, mainCtrl.getMyIdent())),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ssb-chess-mithril",
3
- "version": "2.1.2",
3
+ "version": "2.1.3",
4
4
  "description": "An ssb-chess client",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -1,9 +1,11 @@
1
1
  const m = require('mithril');
2
2
  const SettingsDialog = require('../settings/settings-dialog');
3
3
 
4
- module.exports = (mainCtrl, settings) => {
4
+ module.exports = (mainCtrl, settings, globalObservables) => {
5
5
  m.route.prefix = '?';
6
6
 
7
+ const { gamesWhereMyMove, friendsObservableGames, pendingChallengesReceived, unseenNotifications } = globalObservables;
8
+
7
9
  const gamesInProgress = {
8
10
  name: 'Games',
9
11
  link: '/my_games',
@@ -14,21 +16,21 @@ module.exports = (mainCtrl, settings) => {
14
16
  name: 'My Move',
15
17
  link: '/games_my_move',
16
18
  count: 0,
17
- countUpdateFn: mainCtrl.getGameCtrl().getGamesWhereMyMove,
19
+ countUpdateFn: () => gamesWhereMyMove,
18
20
  countHoverText: () => `${gamesMyMove.count} games awaiting your move.`,
19
21
  };
20
22
  const invitations = {
21
23
  name: 'Invitations',
22
24
  link: '/invitations',
23
25
  count: 0,
24
- countUpdateFn: mainCtrl.getInviteCtrl().pendingChallengesReceived,
26
+ countUpdateFn: () => pendingChallengesReceived,
25
27
  countHoverText: () => `${invitations.count} pending invitations received.`,
26
28
  };
27
29
  const observable = {
28
30
  name: 'Observe',
29
31
  link: '/observable',
30
32
  count: 0,
31
- countUpdateFn: mainCtrl.getGameCtrl().getFriendsObservableGames,
33
+ countUpdateFn: () => friendsObservableGames,
32
34
  countOnHoverOnly: true,
33
35
  countHoverText: () => `${observable.count} observable games.`,
34
36
  };
@@ -36,7 +38,7 @@ module.exports = (mainCtrl, settings) => {
36
38
  name: 'Recent Activity',
37
39
  link: '/activity',
38
40
  count: 0,
39
- countUpdateFn: mainCtrl.getRecentActivityCtrl().unseenNotifications,
41
+ countUpdateFn: () => unseenNotifications,
40
42
  countHoverText: () => 'Recent Activity',
41
43
  };
42
44