Skip to content

Commit

Permalink
quick fix
Browse files Browse the repository at this point in the history
  • Loading branch information
dedpnd committed May 30, 2019
1 parent 92b88f5 commit 87ba831
Showing 1 changed file with 5 additions and 15 deletions.
20 changes: 5 additions & 15 deletions modules/notifiNextSing.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ const getImg = `

exports.init = (win) => {
session.defaultSession.webRequest.onBeforeRequest(['*'], (details, callback) => {
if (/m\?hq/.test(details.url)) {
sendNotifi()
if (/start\?__t/.test(details.url)) {
setTimeout(sendNotifi,1000)
}
callback(details);
})
Expand All @@ -62,21 +62,11 @@ exports.init = (win) => {
let checkData = async () => {
return await win.webContents.executeJavaScript(command);
}
let store, count = 0;

store = await checkData()
while (store === await checkData()) {
await delay(500)
count++
if (count >= 10) {
return null
}
}
return await checkData()
}

// Util
function delay(millis) {
return new Promise((resolve) => setTimeout(resolve, millis));
}
// function delay(millis) {
// return new Promise((resolve) => setTimeout(resolve, millis));
// }
}

0 comments on commit 87ba831

Please sign in to comment.