refactor: simpler rejoin

remove pointless app.cacheBuster = null
isekai-main
Barış Soner Uşaklı 3 years ago
parent e3f5b706a5
commit 619034484f

@ -7,7 +7,6 @@ app.isFocused = true;
app.currentRoom = null; app.currentRoom = null;
app.widgets = {}; app.widgets = {};
app.flags = {}; app.flags = {};
app.cacheBuster = null;
(function () { (function () {
let appLoaded = false; let appLoaded = false;

@ -172,37 +172,11 @@ socket = window.socket;
} }
function reJoinCurrentRoom() { function reJoinCurrentRoom() {
const url_parts = window.location.pathname.slice(config.relative_path.length).split('/').slice(1); if (app.currentRoom) {
let room; const current = app.currentRoom;
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;
}
app.currentRoom = ''; app.currentRoom = '';
app.enterRoom(room); app.enterRoom(current);
}
} }
function onReconnecting() { function onReconnecting() {

Loading…
Cancel
Save