summaryrefslogtreecommitdiffstats
path: root/client
diff options
context:
space:
mode:
authorMaxime Quandalle <maxime@quandalle.com>2015-09-04 01:40:29 +0200
committerMaxime Quandalle <maxime@quandalle.com>2015-09-04 01:44:10 +0200
commit521e661dcb38b5a58b70593f3b805be57bd6746f (patch)
tree9a38fbefdb491ab3564b8fba96acfe1776939b2d /client
parent40fafd4b142c541172cd23dabd8e7304b2a4035b (diff)
downloadwekan-521e661dcb38b5a58b70593f3b805be57bd6746f.tar.gz
wekan-521e661dcb38b5a58b70593f3b805be57bd6746f.tar.bz2
wekan-521e661dcb38b5a58b70593f3b805be57bd6746f.zip
Change our presence package
tmeasday:presence was doing unnecessary ping calls to the server every 5 seconds instead of using the status of the DDP connection (this could save a fair amount of traffic in case of important server load). I guess this change also fixes #221, but since no issue reproduction was provided, it's difficult to tell.
Diffstat (limited to 'client')
-rw-r--r--client/components/users/userAvatar.js2
-rw-r--r--client/config/presence.js7
2 files changed, 8 insertions, 1 deletions
diff --git a/client/components/users/userAvatar.js b/client/components/users/userAvatar.js
index b0702468..5337f6e2 100644
--- a/client/components/users/userAvatar.js
+++ b/client/components/users/userAvatar.js
@@ -16,7 +16,7 @@ Template.userAvatar.helpers({
},
presenceStatusClassName() {
- const userPresence = Presences.findOne({ userId: this.userId });
+ const userPresence = presences.findOne({ userId: this.userId });
if (!userPresence)
return 'disconnected';
else if (Session.equals('currentBoard', userPresence.state.currentBoardId))
diff --git a/client/config/presence.js b/client/config/presence.js
new file mode 100644
index 00000000..39b94e4d
--- /dev/null
+++ b/client/config/presence.js
@@ -0,0 +1,7 @@
+Presence.configure({
+ state() {
+ return {
+ currentBoardId: Session.get('currentBoard'),
+ };
+ },
+});