Refactor the db; move to *Manager classes

This commit is contained in:
Philipp Heckel 2022-03-03 16:52:07 -05:00
parent f9219d2d96
commit 08846e4cc2
12 changed files with 162 additions and 64 deletions

View file

@ -1,8 +1,10 @@
import {formatMessage, formatTitleWithFallback, topicShortUrl} from "./utils";
import prefs from "./Prefs";
import subscriptionManager from "./SubscriptionManager";
class NotificationManager {
async notify(subscription, notification, onClickFallback) {
async notify(subscriptionId, notification, onClickFallback) {
const subscription = await subscriptionManager.get(subscriptionId);
const shouldNotify = await this.shouldNotify(subscription, notification);
if (!shouldNotify) {
return;