mirror of
https://github.com/zoldar/jenot.git
synced 2026-01-03 14:32:54 +00:00
Sync immediately on app window focus
This commit is contained in:
parent
2e0d7d044b
commit
8d12c66141
2 changed files with 8 additions and 7 deletions
|
|
@ -54,7 +54,6 @@
|
|||
</form>
|
||||
|
||||
<div id="notifications-pane" class="hidden">
|
||||
<!-- Hidden for now, until push notifications are implemented -->
|
||||
<button id="enable-notifications" class="hidden">
|
||||
Enable notifications
|
||||
</button>
|
||||
|
|
|
|||
|
|
@ -54,6 +54,8 @@ const sync = async () => {
|
|||
Notes.saveStorage();
|
||||
};
|
||||
|
||||
window.addEventListener("focus", sync);
|
||||
|
||||
if (isLoggedIn) {
|
||||
setInterval(sync, 5000);
|
||||
}
|
||||
|
|
@ -76,7 +78,7 @@ if (!isLoggedIn) {
|
|||
if (notificationsAvailable()) {
|
||||
document.querySelector("#notifications-pane").classList.remove("hidden");
|
||||
const notificationsButton = document.querySelector("#enable-notifications");
|
||||
const notificationsTestButton = document.querySelector("#test-notifications");
|
||||
// const notificationsTestButton = document.querySelector("#test-notifications");
|
||||
|
||||
if (!notificationsEnabled()) {
|
||||
notificationsButton.classList.remove("hidden");
|
||||
|
|
@ -85,11 +87,11 @@ if (notificationsAvailable()) {
|
|||
});
|
||||
}
|
||||
|
||||
notificationsTestButton.addEventListener("click", () => {
|
||||
setTimeout(() => {
|
||||
sendNotification("reminder", "This is a test reminder!");
|
||||
}, 8000);
|
||||
});
|
||||
// notificationsTestButton.addEventListener("click", () => {
|
||||
// setTimeout(() => {
|
||||
// sendNotification("reminder", "This is a test reminder!");
|
||||
// }, 8000);
|
||||
// });
|
||||
}
|
||||
|
||||
// Search
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue