Files
element-web/src/stores/notifications/NotificationLevel.ts
David Langley 69ee8fd96a Change License: AGPL + Element Commercial (#28856)
* Add commercial licence and update config files

* Update license in headers

* Revert "Update license in headers"

This reverts commit 7ed7949485.

* Update only spdx id

* Remove LicenseRef- from package.json

LicenseRef- no longer allowed in npm v3 package.json
This fixes the warning in the logs and failing build check.
2025-01-06 11:18:54 +00:00

38 lines
1.3 KiB
TypeScript

/*
Copyright 2024 New Vector Ltd.
Copyright 2020 The Matrix.org Foundation C.I.C.
SPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only OR LicenseRef-Element-Commercial
Please see LICENSE files in the repository root for full details.
*/
import { _t } from "../../languageHandler";
export enum NotificationLevel {
Muted,
// Inverted (None -> Red) because we do integer comparisons on this
None, // nothing special
// TODO: Remove bold with notifications: https://github.com/vector-im/element-web/issues/14227
Activity, // no badge, show as unread
Notification, // unread notified messages
Highlight, // unread pings
Unsent, // some messages failed to send
}
export function humanReadableNotificationLevel(level: NotificationLevel): string {
switch (level) {
case NotificationLevel.None:
return _t("notifications|level_none");
case NotificationLevel.Activity:
return _t("notifications|level_activity");
case NotificationLevel.Notification:
return _t("notifications|level_notification");
case NotificationLevel.Highlight:
return _t("notifications|level_highlight");
case NotificationLevel.Unsent:
return _t("notifications|level_unsent");
case NotificationLevel.Muted:
return _t("notifications|level_muted");
}
}