A self hosted chat application with end-to-end encrypted messaging.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

26 lines
937 B

  1. import { NotificationService } from "./NotificationService";
  2. // @ts-ignore
  3. import * as alertify from "alertifyjs";
  4. export class AlertifyNotificationService implements NotificationService {
  5. private readonly _alertify = alertify;
  6. constructor() {
  7. this._alertify.set('notifier', 'position', 'top-center');
  8. }
  9. success(message: string): void {
  10. this._alertify.success(message)
  11. }
  12. error(message: string): void {
  13. this._alertify.error(message);
  14. }
  15. errorWithDelay(message: string, delay: number): void {
  16. const _delay = this._alertify.get('notifier', 'delay');
  17. this._alertify.set('notifier', 'delay', delay);
  18. this._alertify.error(message);
  19. this._alertify.set('notifier', 'delay', _delay);
  20. }
  21. warning(message: string): void {
  22. this._alertify.warning(message);
  23. }
  24. message(message: string): void {
  25. this._alertify.message(message);
  26. }
  27. }