Cosmetic changess
This commit is contained in:
parent
b197ea3ab6
commit
6e95d62726
4 changed files with 65 additions and 45 deletions
|
@ -1,5 +1,5 @@
|
|||
import { playSound, topicDisplayName, topicShortUrl, urlB64ToUint8Array } from "./utils";
|
||||
import { getNotificationParams } from "./notificationUtils";
|
||||
import { toNotificationParams } from "./notificationUtils";
|
||||
import prefs from "./Prefs";
|
||||
import routes from "../components/routes";
|
||||
|
||||
|
@ -22,7 +22,7 @@ class Notifier {
|
|||
|
||||
const registration = await this.serviceWorkerRegistration();
|
||||
await registration.showNotification(
|
||||
...getNotificationParams({
|
||||
...toNotificationParams({
|
||||
subscriptionId: subscription.id,
|
||||
message: notification,
|
||||
defaultTitle,
|
||||
|
|
|
@ -39,7 +39,7 @@ const isImage = (filenameOrUrl) => filenameOrUrl?.match(/\.(png|jpe?g|gif|webp)$
|
|||
export const icon = "/static/images/ntfy.png";
|
||||
export const badge = "/static/images/mask-icon.svg";
|
||||
|
||||
export const getNotificationParams = ({ subscriptionId, message, defaultTitle, topicRoute }) => {
|
||||
export const toNotificationParams = ({ subscriptionId, message, defaultTitle, topicRoute }) => {
|
||||
const image = isImage(message.attachment?.name) ? message.attachment.url : undefined;
|
||||
|
||||
// https://developer.mozilla.org/en-US/docs/Web/API/Notifications_API
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue