UserCP Screeching Frog 0.7583
- Removed
setInterval()
for user presence and moved user presence method to updated()
Vue.js
lifecycle hook.
methods: {
getHereNow() {
var that = this;
pubnub.hereNow(
{
channels: ["livechat"],
includeUUIDs: true,
includeState: true
},
function(status, response) {
that.psoccupancy = response.totalOccupancy;
var allusers = "";
var index = 0;
response.channels.livechat.occupants.forEach(function(user) {
if (response.channels.livechat.occupants) {
that.userarray.push(user);
if (index == 0) allusers = user.uuid;
else allusers = allusers + ", " + user.uuid;
}
index++;
that.userlist = allusers;
});
}
);
}
UserCP Screeching Frog 0.7584
- Added 1 sec
debounce()
in updated()
lifecycle hook for getHerNow()
method.
updated() {
debounce(this.getHereNow, 1000);
},
UserCP Screeching Frog 0.7585
- Trigger
debounce()
on leading edge of debounce interval.
updated() {
debounce(this.getHereNow, 1000, true);
},
UserCP Screeching Frog 0.7586
- Trigger
debounce()
on trailing edge of debounce interval.
updated() {
debounce(this.getHereNow, 1000, false);
},
UserCP Screeching Frog 0.7587
- Trigger
debounce()
on leading edge of debounce interval (revert changes).
- Remove
getHereNow()
from mounted()
lifecycle hook.
updated() {
debounce(this.getHereNow, 1000, true);
},
UserCP Screeching Frog 0.7589
- Still tweaking
this.getHereNow()
in lifecycle hooks.
If the debouncing is working "good enough" and the unnecessary PubNub transactions are reduced without setInterval(),
then we are good to go to build out a beta PM replacement on this live chat foundation on a per member basis.
UserCP Screeching Frog 0.7590
- Added up and down indicator icon to the right of "Toggle Message Order".