mirror of
https://github.com/KevinMidboe/zoff.git
synced 2025-10-29 18:00:23 +00:00
Fixed frontpage-sorting issue
This commit is contained in:
@@ -27,7 +27,7 @@ function get_frontpage_lists(callback) {
|
||||
"id": 1,
|
||||
"title": 1,
|
||||
"viewers": 1,
|
||||
"pinned": 1,
|
||||
"pinned": { $ifNull: [ "$pinned", 0 ] },
|
||||
"description": {
|
||||
$ifNull: [ {$cond: {
|
||||
"if": {
|
||||
|
||||
@@ -681,7 +681,12 @@ var Channel = {
|
||||
var newList = response.querySelector("#lists-script").innerHTML;
|
||||
newList = newList.trim().replace("window.lists = ", "");
|
||||
newList = newList.substring(0, newList.length);
|
||||
window.lists = JSON.parse(newList);
|
||||
try {
|
||||
window.lists = JSON.parse(newList);
|
||||
} catch(e) {
|
||||
console.error(e);
|
||||
console.log(newList);
|
||||
}
|
||||
response.querySelector("#lists-script").remove();
|
||||
Helper.removeElement("#sidenav-overlay");
|
||||
document.getElementsByTagName("main")[0].className = "center-align container";
|
||||
|
||||
@@ -27,7 +27,7 @@ var Frontpage = {
|
||||
window.lists = undefined;
|
||||
//document.querySelector("#lists-script").remove();
|
||||
if(msg.length == 0) {
|
||||
Helper.css("#preloader", "display", "none");
|
||||
//Helper.css("#preloader", "display", "none");
|
||||
document.getElementById("channel-list-container").insertAdjacentHTML("beforeend", "<p>No channels yet</p>");
|
||||
} else {
|
||||
Frontpage.populate_channels(msg, true, false);
|
||||
|
||||
Reference in New Issue
Block a user