Implement push subscription expiry

This commit is contained in:
nimbleghost 2023-06-02 14:45:05 +02:00
parent 47ad024ec7
commit 0f0074cbab
16 changed files with 272 additions and 102 deletions

View file

@ -42,4 +42,5 @@ class Prefs {
}
}
export default new Prefs(getDb());
const prefs = new Prefs(getDb());
export default prefs;

View file

@ -57,7 +57,6 @@ import { IncorrectPasswordError, UnauthorizedError } from "../app/errors";
import { ProChip } from "./SubscriptionPopup";
import theme from "./theme";
import session from "../app/Session";
import subscriptionManager from "../app/SubscriptionManager";
const Account = () => {
if (!session.exists()) {

View file

@ -58,9 +58,7 @@ const App = () => {
const updateTitle = (newNotificationsCount) => {
document.title = newNotificationsCount > 0 ? `(${newNotificationsCount}) ntfy` : "ntfy";
if ("setAppBadge" in window.navigator) {
window.navigator.setAppBadge(newNotificationsCount);
}
window.navigator.setAppBadge?.(newNotificationsCount);
};
const Layout = () => {

View file

@ -10,7 +10,6 @@ import session from "../app/Session";
import accountApi from "../app/AccountApi";
import { UnauthorizedError } from "../app/errors";
import { webPushRefreshWorker, useWebPushUpdateWorker } from "../app/WebPushWorker";
import notifier from "../app/Notifier";
/**
* Wire connectionManager and subscriptionManager so that subscriptions are updated when the connection