Check only during work hours
This commit is contained in:
parent
3e750e2e6e
commit
9c9c9c74d8
@ -62,7 +62,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
function send_notif_to_phone(data) {
|
function send_notif_to_phone(data) {
|
||||||
fetch('https://ntfy.sh/snegov', {
|
fetch('https://ntfy.sh/snegov_test', {
|
||||||
method: 'POST', // PUT works too
|
method: 'POST', // PUT works too
|
||||||
body: `[US Visa Rescheduler]: ${data}`
|
body: `[US Visa Rescheduler]: ${data}`
|
||||||
})
|
})
|
||||||
@ -98,6 +98,12 @@
|
|||||||
return d.value;
|
return d.value;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
let currentHour = new Date().getHours();
|
||||||
|
if (currentHour > 2 && currentHour < 16) {
|
||||||
|
console.log("Current time is not within the working hours. Will check again after 1 minute.")
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
await delay($delay);
|
await delay($delay);
|
||||||
let now = new Date(),
|
let now = new Date(),
|
||||||
nowInLocale = now.toLocaleString(),
|
nowInLocale = now.toLocaleString(),
|
||||||
|
|||||||
@ -24,5 +24,5 @@
|
|||||||
"manifest_version": 3,
|
"manifest_version": 3,
|
||||||
"name": "not-a-rescheduler",
|
"name": "not-a-rescheduler",
|
||||||
"permissions": [ "storage", "tabs", "activeTab", "notifications", "declarativeContent" ],
|
"permissions": [ "storage", "tabs", "activeTab", "notifications", "declarativeContent" ],
|
||||||
"version": "0.0.7"
|
"version": "0.0.13"
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user