Refactor the db; move to *Manager classes
This commit is contained in:
parent
f9219d2d96
commit
08846e4cc2
12 changed files with 162 additions and 64 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue