mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-07 14:35:47 +01:00
refactor: simpler rejoin
remove pointless app.cacheBuster = null
This commit is contained in:
@@ -7,7 +7,6 @@ app.isFocused = true;
|
||||
app.currentRoom = null;
|
||||
app.widgets = {};
|
||||
app.flags = {};
|
||||
app.cacheBuster = null;
|
||||
|
||||
(function () {
|
||||
let appLoaded = false;
|
||||
|
||||
@@ -172,37 +172,11 @@ socket = window.socket;
|
||||
}
|
||||
|
||||
function reJoinCurrentRoom() {
|
||||
const url_parts = window.location.pathname.slice(config.relative_path.length).split('/').slice(1);
|
||||
let room;
|
||||
|
||||
switch (url_parts[0]) {
|
||||
case 'user':
|
||||
room = 'user/' + (ajaxify.data ? ajaxify.data.theirid : 0);
|
||||
break;
|
||||
case 'topic':
|
||||
room = 'topic_' + url_parts[1];
|
||||
break;
|
||||
case 'category':
|
||||
room = 'category_' + url_parts[1];
|
||||
break;
|
||||
case 'recent':
|
||||
room = 'recent_topics';
|
||||
break;
|
||||
case 'unread':
|
||||
room = 'unread_topics';
|
||||
break;
|
||||
case 'popular':
|
||||
room = 'popular_topics';
|
||||
break;
|
||||
case 'admin':
|
||||
room = 'admin';
|
||||
break;
|
||||
case 'categories':
|
||||
room = 'categories';
|
||||
break;
|
||||
}
|
||||
if (app.currentRoom) {
|
||||
const current = app.currentRoom;
|
||||
app.currentRoom = '';
|
||||
app.enterRoom(room);
|
||||
app.enterRoom(current);
|
||||
}
|
||||
}
|
||||
|
||||
function onReconnecting() {
|
||||
|
||||
Reference in New Issue
Block a user