mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-18 07:07:35 +01:00
pusher: remove commented code that is unused
This commit is contained in:
@@ -14,17 +14,7 @@ angular.module('habitrpg')
|
|||||||
socketId: undefined, // when defined the user is connected
|
socketId: undefined, // when defined the user is connected
|
||||||
};
|
};
|
||||||
|
|
||||||
// Limit of 1 connected tab is disabled for now
|
|
||||||
// var tabIdKey = 'habitica-active-tab';
|
|
||||||
// var tabId = Shared.uuid();
|
|
||||||
|
|
||||||
function connectToPusher (partyId, reconnecting) {
|
function connectToPusher (partyId, reconnecting) {
|
||||||
// Limit of 1 connected tab is disabled for now
|
|
||||||
// localStorage.setItem(tabIdKey, tabId);
|
|
||||||
// window.onbeforeunload = function () {
|
|
||||||
// localStorage.removeItem(tabIdKey);
|
|
||||||
// }
|
|
||||||
|
|
||||||
api.pusher = new Pusher(window.env['PUSHER:KEY'], {
|
api.pusher = new Pusher(window.env['PUSHER:KEY'], {
|
||||||
encrypted: true,
|
encrypted: true,
|
||||||
authEndpoint: '/api/v3/user/auth/pusher',
|
authEndpoint: '/api/v3/user/auth/pusher',
|
||||||
@@ -153,24 +143,6 @@ angular.module('habitrpg')
|
|||||||
if (!partyId) return;
|
if (!partyId) return;
|
||||||
|
|
||||||
connectToPusher(partyId);
|
connectToPusher(partyId);
|
||||||
|
|
||||||
// DISABLED FOR NOW
|
|
||||||
// See if another tab is already connected to Pusher
|
|
||||||
// if (!localStorage.getItem(tabIdKey)) {
|
|
||||||
// connectToPusher(partyId);
|
|
||||||
// }
|
|
||||||
|
|
||||||
// when a tab is closed, connect the next one
|
|
||||||
// wait between 100 and 500ms to avoid two tabs connecting at the same time
|
|
||||||
// window.addEventListener('storage', function(e) {
|
|
||||||
// if (e.key === tabIdKey && e.newValue === null) {
|
|
||||||
// setTimeout(function () {
|
|
||||||
// if (!localStorage.getItem(tabIdKey)) {
|
|
||||||
// connectToPusher(partyId, true);
|
|
||||||
// }
|
|
||||||
// }, Math.floor(Math.random() * 501) + 100);
|
|
||||||
// }
|
|
||||||
// });
|
|
||||||
});
|
});
|
||||||
|
|
||||||
return api;
|
return api;
|
||||||
|
|||||||
Reference in New Issue
Block a user