tweaks for the notification message
This commit is contained in:
parent
85a1bb76b5
commit
e327e6acc9
|
@ -82,7 +82,7 @@ function getItem(id) {
|
|||
try {
|
||||
return fetch(url).then(response => response.json().then(obj => obj))
|
||||
} catch (e) {
|
||||
console.log(`[getItem]: failed to fetch item ${id}`)
|
||||
console.log(`[getItem] failed to fetch item ${id}`)
|
||||
return
|
||||
}
|
||||
}
|
||||
|
@ -91,13 +91,13 @@ function getItem(id) {
|
|||
function makeItemListing(itemObj) {
|
||||
|
||||
if (itemObj === null || itemObj === undefined) {
|
||||
console.log(`[makeItemListing]: null or undefined object`)
|
||||
console.log(`[makeItemListing] null or undefined object`)
|
||||
clearInterval(loader_id)
|
||||
return
|
||||
}
|
||||
|
||||
if (itemObj.deleted || itemObj.dead || itemObj.title == "[deleted]") {
|
||||
console.log(`[makeItemListing]: bad item: ${itemObj.id}`)
|
||||
console.log(`[makeItemListing] bad item: ${itemObj.id}`)
|
||||
return
|
||||
}
|
||||
|
||||
|
@ -123,7 +123,7 @@ function makeItemListing(itemObj) {
|
|||
if (itemObj.type != itemType.job) {
|
||||
subtitle += ` | ${comments} comments`
|
||||
} else {
|
||||
console.log(`[makeItemListing]: job item ${title}`)
|
||||
console.log(`[makeItemListing] job item ${title}`)
|
||||
}
|
||||
|
||||
const element_string =`
|
||||
|
@ -416,7 +416,7 @@ async function notify(count) {
|
|||
return
|
||||
}
|
||||
|
||||
new Notification("Clone Wars", { body: `${count} new Post`})
|
||||
new Notification("Clone Wars", { body: "new Posts"})
|
||||
}
|
||||
|
||||
async function loadFresh() {
|
||||
|
@ -435,7 +435,7 @@ async function loadFresh() {
|
|||
return
|
||||
}
|
||||
|
||||
console.log(`[loadFresh]: new items ${newMax - endItem}`)
|
||||
console.log(`[loadFresh] new items ${newMax - endItem}`)
|
||||
let count = 0
|
||||
|
||||
let intervalId = setInterval(async () => {
|
||||
|
@ -473,8 +473,7 @@ if (newMode) {
|
|||
|
||||
|
||||
if (!isQuery) {
|
||||
setInterval(() => {
|
||||
Array.from(pageItemBox.getElementsByTagName('a')).map(c => {
|
||||
setInterval(() => Array.from(pageItemBox.getElementsByTagName('a')).map(c => {
|
||||
|
||||
if (!c.time) {
|
||||
return
|
||||
|
@ -494,6 +493,5 @@ if (!isQuery) {
|
|||
}
|
||||
|
||||
sub.innerHTML = subtitle
|
||||
})
|
||||
}, 1e3)
|
||||
}), 1e3)
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue