forked from jsnbuchanan/crowd-funder-for-time-pwa
Refactor notification usage and apply TypeScript/lint improvements
- Replaced direct $notify calls with notification helper utilities for consistency and reduced duplication. - Updated AccountViewView.vue, PlatformServiceMixin.ts, and ShareMyContactInfoView.vue to use notification helpers. - Added explicit TypeScript types and constants for notification patterns. - Suppressed ESLint 'any' warning in notification mixin helper. - Ensured all affected files pass linting.
This commit is contained in:
@@ -27,12 +27,12 @@ export interface NotificationHelper {
|
||||
* Standard notification timeouts
|
||||
*/
|
||||
export const NOTIFICATION_TIMEOUTS = {
|
||||
BRIEF: 1000, // Very brief toasts ("Sent..." messages)
|
||||
SHORT: 2000, // Short notifications (clipboard copies, quick confirmations)
|
||||
STANDARD: 3000, // Standard notifications (success messages, general info)
|
||||
LONG: 5000, // Longer notifications (errors, warnings, important info)
|
||||
VERY_LONG: 7000, // Very long notifications (complex operations)
|
||||
MODAL: -1, // Modal confirmations (no auto-dismiss)
|
||||
BRIEF: 1000, // Very brief toasts ("Sent..." messages)
|
||||
SHORT: 2000, // Short notifications (clipboard copies, quick confirmations)
|
||||
STANDARD: 3000, // Standard notifications (success messages, general info)
|
||||
LONG: 5000, // Longer notifications (errors, warnings, important info)
|
||||
VERY_LONG: 7000, // Very long notifications (complex operations)
|
||||
MODAL: -1, // Modal confirmations (no auto-dismiss)
|
||||
} as const;
|
||||
|
||||
/**
|
||||
@@ -61,8 +61,10 @@ export const NOTIFICATION_MESSAGES = {
|
||||
SENT_BRIEF: "Sent...",
|
||||
CONFIRMATION_SUBMITTED: "Confirmation submitted.",
|
||||
ALREADY_CONFIRMED: "You already confirmed this claim.",
|
||||
CANNOT_CONFIRM_ISSUER: "You cannot confirm this because you issued this claim.",
|
||||
CANNOT_CONFIRM_HIDDEN: "You cannot confirm this because some people are hidden.",
|
||||
CANNOT_CONFIRM_ISSUER:
|
||||
"You cannot confirm this because you issued this claim.",
|
||||
CANNOT_CONFIRM_HIDDEN:
|
||||
"You cannot confirm this because some people are hidden.",
|
||||
NOT_REGISTERED: "Someone needs to register you before you can confirm.",
|
||||
NOT_A_GIVE: "This is not a giving action to confirm.",
|
||||
} as const;
|
||||
@@ -70,143 +72,195 @@ export const NOTIFICATION_MESSAGES = {
|
||||
/**
|
||||
* Creates a notification helper with utility methods
|
||||
*/
|
||||
export function createNotificationHelper(notifyFn: (notification: NotificationIface, timeout?: number) => void): NotificationHelper {
|
||||
export function createNotificationHelper(
|
||||
notifyFn: (notification: NotificationIface, timeout?: number) => void,
|
||||
): NotificationHelper {
|
||||
return {
|
||||
notify: notifyFn,
|
||||
|
||||
|
||||
// Success notifications
|
||||
success: (text: string, timeout = NOTIFICATION_TIMEOUTS.STANDARD) => {
|
||||
notifyFn({
|
||||
group: "alert",
|
||||
type: "success",
|
||||
title: NOTIFICATION_TITLES.SUCCESS,
|
||||
text,
|
||||
}, timeout);
|
||||
notifyFn(
|
||||
{
|
||||
group: "alert",
|
||||
type: "success",
|
||||
title: NOTIFICATION_TITLES.SUCCESS,
|
||||
text,
|
||||
},
|
||||
timeout,
|
||||
);
|
||||
},
|
||||
|
||||
// Error notifications
|
||||
error: (text: string, timeout = NOTIFICATION_TIMEOUTS.LONG) => {
|
||||
notifyFn({
|
||||
group: "alert",
|
||||
type: "danger",
|
||||
title: NOTIFICATION_TITLES.ERROR,
|
||||
text,
|
||||
}, timeout);
|
||||
notifyFn(
|
||||
{
|
||||
group: "alert",
|
||||
type: "danger",
|
||||
title: NOTIFICATION_TITLES.ERROR,
|
||||
text,
|
||||
},
|
||||
timeout,
|
||||
);
|
||||
},
|
||||
|
||||
// Warning notifications
|
||||
warning: (text: string, timeout = NOTIFICATION_TIMEOUTS.LONG) => {
|
||||
notifyFn({
|
||||
group: "alert",
|
||||
type: "warning",
|
||||
title: NOTIFICATION_TITLES.WARNING,
|
||||
text,
|
||||
}, timeout);
|
||||
notifyFn(
|
||||
{
|
||||
group: "alert",
|
||||
type: "warning",
|
||||
title: NOTIFICATION_TITLES.WARNING,
|
||||
text,
|
||||
},
|
||||
timeout,
|
||||
);
|
||||
},
|
||||
|
||||
// Info notifications
|
||||
info: (text: string, timeout = NOTIFICATION_TIMEOUTS.STANDARD) => {
|
||||
notifyFn({
|
||||
group: "alert",
|
||||
type: "info",
|
||||
title: NOTIFICATION_TITLES.INFO,
|
||||
text,
|
||||
}, timeout);
|
||||
notifyFn(
|
||||
{
|
||||
group: "alert",
|
||||
type: "info",
|
||||
title: NOTIFICATION_TITLES.INFO,
|
||||
text,
|
||||
},
|
||||
timeout,
|
||||
);
|
||||
},
|
||||
|
||||
// Toast notifications (brief)
|
||||
toast: (title: string, text?: string, timeout = NOTIFICATION_TIMEOUTS.BRIEF) => {
|
||||
notifyFn({
|
||||
group: "alert",
|
||||
type: "toast",
|
||||
title,
|
||||
text,
|
||||
}, timeout);
|
||||
toast: (
|
||||
title: string,
|
||||
text?: string,
|
||||
timeout = NOTIFICATION_TIMEOUTS.BRIEF,
|
||||
) => {
|
||||
notifyFn(
|
||||
{
|
||||
group: "alert",
|
||||
type: "toast",
|
||||
title,
|
||||
text,
|
||||
},
|
||||
timeout,
|
||||
);
|
||||
},
|
||||
|
||||
// Clipboard copy notifications
|
||||
copied: (item: string, timeout = NOTIFICATION_TIMEOUTS.SHORT) => {
|
||||
notifyFn({
|
||||
group: "alert",
|
||||
type: "toast",
|
||||
title: NOTIFICATION_TITLES.COPIED,
|
||||
text: NOTIFICATION_MESSAGES.CLIPBOARD_COPIED(item),
|
||||
}, timeout);
|
||||
notifyFn(
|
||||
{
|
||||
group: "alert",
|
||||
type: "toast",
|
||||
title: NOTIFICATION_TITLES.COPIED,
|
||||
text: NOTIFICATION_MESSAGES.CLIPBOARD_COPIED(item),
|
||||
},
|
||||
timeout,
|
||||
);
|
||||
},
|
||||
|
||||
// Sent brief notification
|
||||
sent: (timeout = NOTIFICATION_TIMEOUTS.BRIEF) => {
|
||||
notifyFn({
|
||||
group: "alert",
|
||||
type: "toast",
|
||||
title: NOTIFICATION_TITLES.SENT,
|
||||
}, timeout);
|
||||
notifyFn(
|
||||
{
|
||||
group: "alert",
|
||||
type: "toast",
|
||||
title: NOTIFICATION_TITLES.SENT,
|
||||
},
|
||||
timeout,
|
||||
);
|
||||
},
|
||||
|
||||
// Confirmation modal
|
||||
confirm: (text: string, onYes: () => Promise<void>, timeout = NOTIFICATION_TIMEOUTS.MODAL) => {
|
||||
notifyFn({
|
||||
group: "modal",
|
||||
type: "confirm",
|
||||
title: NOTIFICATION_TITLES.CONFIRM,
|
||||
text,
|
||||
onYes,
|
||||
}, timeout);
|
||||
confirm: (
|
||||
text: string,
|
||||
onYes: () => Promise<void>,
|
||||
timeout = NOTIFICATION_TIMEOUTS.MODAL,
|
||||
) => {
|
||||
notifyFn(
|
||||
{
|
||||
group: "modal",
|
||||
type: "confirm",
|
||||
title: NOTIFICATION_TITLES.CONFIRM,
|
||||
text,
|
||||
onYes,
|
||||
},
|
||||
timeout,
|
||||
);
|
||||
},
|
||||
|
||||
// Standard confirmation messages
|
||||
confirmationSubmitted: (timeout = NOTIFICATION_TIMEOUTS.STANDARD) => {
|
||||
notifyFn({
|
||||
group: "alert",
|
||||
type: "success",
|
||||
title: NOTIFICATION_TITLES.SUCCESS,
|
||||
text: NOTIFICATION_MESSAGES.CONFIRMATION_SUBMITTED,
|
||||
}, timeout);
|
||||
notifyFn(
|
||||
{
|
||||
group: "alert",
|
||||
type: "success",
|
||||
title: NOTIFICATION_TITLES.SUCCESS,
|
||||
text: NOTIFICATION_MESSAGES.CONFIRMATION_SUBMITTED,
|
||||
},
|
||||
timeout,
|
||||
);
|
||||
},
|
||||
|
||||
alreadyConfirmed: (timeout = NOTIFICATION_TIMEOUTS.STANDARD) => {
|
||||
notifyFn({
|
||||
group: "alert",
|
||||
type: "info",
|
||||
title: NOTIFICATION_TITLES.ALREADY_CONFIRMED,
|
||||
text: NOTIFICATION_MESSAGES.ALREADY_CONFIRMED,
|
||||
}, timeout);
|
||||
notifyFn(
|
||||
{
|
||||
group: "alert",
|
||||
type: "info",
|
||||
title: NOTIFICATION_TITLES.ALREADY_CONFIRMED,
|
||||
text: NOTIFICATION_MESSAGES.ALREADY_CONFIRMED,
|
||||
},
|
||||
timeout,
|
||||
);
|
||||
},
|
||||
|
||||
cannotConfirmIssuer: (timeout = NOTIFICATION_TIMEOUTS.STANDARD) => {
|
||||
notifyFn({
|
||||
group: "alert",
|
||||
type: "info",
|
||||
title: NOTIFICATION_TITLES.CANNOT_CONFIRM,
|
||||
text: NOTIFICATION_MESSAGES.CANNOT_CONFIRM_ISSUER,
|
||||
}, timeout);
|
||||
notifyFn(
|
||||
{
|
||||
group: "alert",
|
||||
type: "info",
|
||||
title: NOTIFICATION_TITLES.CANNOT_CONFIRM,
|
||||
text: NOTIFICATION_MESSAGES.CANNOT_CONFIRM_ISSUER,
|
||||
},
|
||||
timeout,
|
||||
);
|
||||
},
|
||||
|
||||
cannotConfirmHidden: (timeout = NOTIFICATION_TIMEOUTS.STANDARD) => {
|
||||
notifyFn({
|
||||
group: "alert",
|
||||
type: "info",
|
||||
title: NOTIFICATION_TITLES.CANNOT_CONFIRM,
|
||||
text: NOTIFICATION_MESSAGES.CANNOT_CONFIRM_HIDDEN,
|
||||
}, timeout);
|
||||
notifyFn(
|
||||
{
|
||||
group: "alert",
|
||||
type: "info",
|
||||
title: NOTIFICATION_TITLES.CANNOT_CONFIRM,
|
||||
text: NOTIFICATION_MESSAGES.CANNOT_CONFIRM_HIDDEN,
|
||||
},
|
||||
timeout,
|
||||
);
|
||||
},
|
||||
|
||||
notRegistered: (timeout = NOTIFICATION_TIMEOUTS.STANDARD) => {
|
||||
notifyFn({
|
||||
group: "alert",
|
||||
type: "info",
|
||||
title: NOTIFICATION_TITLES.NOT_REGISTERED,
|
||||
text: NOTIFICATION_MESSAGES.NOT_REGISTERED,
|
||||
}, timeout);
|
||||
notifyFn(
|
||||
{
|
||||
group: "alert",
|
||||
type: "info",
|
||||
title: NOTIFICATION_TITLES.NOT_REGISTERED,
|
||||
text: NOTIFICATION_MESSAGES.NOT_REGISTERED,
|
||||
},
|
||||
timeout,
|
||||
);
|
||||
},
|
||||
|
||||
notAGive: (timeout = NOTIFICATION_TIMEOUTS.STANDARD) => {
|
||||
notifyFn({
|
||||
group: "alert",
|
||||
type: "info",
|
||||
title: NOTIFICATION_TITLES.INFO,
|
||||
text: NOTIFICATION_MESSAGES.NOT_A_GIVE,
|
||||
}, timeout);
|
||||
notifyFn(
|
||||
{
|
||||
group: "alert",
|
||||
type: "info",
|
||||
title: NOTIFICATION_TITLES.INFO,
|
||||
text: NOTIFICATION_MESSAGES.NOT_A_GIVE,
|
||||
},
|
||||
timeout,
|
||||
);
|
||||
},
|
||||
};
|
||||
}
|
||||
@@ -217,7 +271,8 @@ export function createNotificationHelper(notifyFn: (notification: NotificationIf
|
||||
export const NotificationMixin = {
|
||||
computed: {
|
||||
$notifyHelper() {
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
return createNotificationHelper((this as any).$notify);
|
||||
},
|
||||
},
|
||||
};
|
||||
};
|
||||
|
||||
@@ -1,20 +1,23 @@
|
||||
import { NotificationIface } from '../constants/app';
|
||||
import { NotificationIface } from "../constants/app";
|
||||
|
||||
/**
|
||||
* Simple notification utility functions
|
||||
* Provides the most concise API for common notification patterns
|
||||
*/
|
||||
|
||||
export type NotifyFunction = (notification: NotificationIface, timeout?: number) => void;
|
||||
export type NotifyFunction = (
|
||||
notification: NotificationIface,
|
||||
timeout?: number,
|
||||
) => void;
|
||||
|
||||
// Standard timeouts
|
||||
export const TIMEOUTS = {
|
||||
BRIEF: 1000, // Very brief toasts ("Sent..." messages)
|
||||
SHORT: 2000, // Short notifications (clipboard copies, quick confirmations)
|
||||
STANDARD: 3000, // Standard notifications (success messages, general info)
|
||||
LONG: 5000, // Longer notifications (errors, warnings, important info)
|
||||
VERY_LONG: 7000, // Very long notifications (complex operations)
|
||||
MODAL: -1, // Modal confirmations (no auto-dismiss)
|
||||
BRIEF: 1000, // Very brief toasts ("Sent..." messages)
|
||||
SHORT: 2000, // Short notifications (clipboard copies, quick confirmations)
|
||||
STANDARD: 3000, // Standard notifications (success messages, general info)
|
||||
LONG: 5000, // Longer notifications (errors, warnings, important info)
|
||||
VERY_LONG: 7000, // Very long notifications (complex operations)
|
||||
MODAL: -1, // Modal confirmations (no auto-dismiss)
|
||||
} as const;
|
||||
|
||||
/**
|
||||
@@ -23,114 +26,191 @@ export const TIMEOUTS = {
|
||||
export function createNotifyHelpers(notify: NotifyFunction) {
|
||||
return {
|
||||
// Success notifications
|
||||
success: (text: string, timeout?: number) =>
|
||||
notify({ group: "alert", type: "success", title: "Success", text }, timeout || TIMEOUTS.STANDARD),
|
||||
success: (text: string, timeout?: number) =>
|
||||
notify(
|
||||
{ group: "alert", type: "success", title: "Success", text },
|
||||
timeout || TIMEOUTS.STANDARD,
|
||||
),
|
||||
|
||||
// Error notifications
|
||||
error: (text: string, timeout?: number) =>
|
||||
notify({ group: "alert", type: "danger", title: "Error", text }, timeout || TIMEOUTS.LONG),
|
||||
error: (text: string, timeout?: number) =>
|
||||
notify(
|
||||
{ group: "alert", type: "danger", title: "Error", text },
|
||||
timeout || TIMEOUTS.LONG,
|
||||
),
|
||||
|
||||
// Warning notifications
|
||||
warning: (text: string, timeout?: number) =>
|
||||
notify({ group: "alert", type: "warning", title: "Warning", text }, timeout || TIMEOUTS.LONG),
|
||||
warning: (text: string, timeout?: number) =>
|
||||
notify(
|
||||
{ group: "alert", type: "warning", title: "Warning", text },
|
||||
timeout || TIMEOUTS.LONG,
|
||||
),
|
||||
|
||||
// Info notifications
|
||||
info: (text: string, timeout?: number) =>
|
||||
notify({ group: "alert", type: "info", title: "Info", text }, timeout || TIMEOUTS.STANDARD),
|
||||
info: (text: string, timeout?: number) =>
|
||||
notify(
|
||||
{ group: "alert", type: "info", title: "Info", text },
|
||||
timeout || TIMEOUTS.STANDARD,
|
||||
),
|
||||
|
||||
// Toast notifications (brief)
|
||||
toast: (title: string, text?: string, timeout?: number) =>
|
||||
notify({ group: "alert", type: "toast", title, text }, timeout || TIMEOUTS.BRIEF),
|
||||
toast: (title: string, text?: string, timeout?: number) =>
|
||||
notify(
|
||||
{ group: "alert", type: "toast", title, text },
|
||||
timeout || TIMEOUTS.BRIEF,
|
||||
),
|
||||
|
||||
// Clipboard copy notifications
|
||||
copied: (item: string, timeout?: number) =>
|
||||
notify({
|
||||
group: "alert",
|
||||
type: "toast",
|
||||
title: "Copied",
|
||||
text: `${item} was copied to the clipboard.`
|
||||
}, timeout || TIMEOUTS.SHORT),
|
||||
copied: (item: string, timeout?: number) =>
|
||||
notify(
|
||||
{
|
||||
group: "alert",
|
||||
type: "toast",
|
||||
title: "Copied",
|
||||
text: `${item} was copied to the clipboard.`,
|
||||
},
|
||||
timeout || TIMEOUTS.SHORT,
|
||||
),
|
||||
|
||||
// Sent brief notification
|
||||
sent: (timeout?: number) =>
|
||||
notify({ group: "alert", type: "toast", title: "Sent..." }, timeout || TIMEOUTS.BRIEF),
|
||||
sent: (timeout?: number) =>
|
||||
notify(
|
||||
{ group: "alert", type: "toast", title: "Sent..." },
|
||||
timeout || TIMEOUTS.BRIEF,
|
||||
),
|
||||
|
||||
// Confirmation modal
|
||||
confirm: (text: string, onYes: () => Promise<void>, timeout?: number) =>
|
||||
notify({
|
||||
group: "modal",
|
||||
type: "confirm",
|
||||
title: "Confirm",
|
||||
text,
|
||||
onYes
|
||||
}, timeout || TIMEOUTS.MODAL),
|
||||
confirm: (text: string, onYes: () => Promise<void>, timeout?: number) =>
|
||||
notify(
|
||||
{
|
||||
group: "modal",
|
||||
type: "confirm",
|
||||
title: "Confirm",
|
||||
text,
|
||||
onYes,
|
||||
},
|
||||
timeout || TIMEOUTS.MODAL,
|
||||
),
|
||||
|
||||
// Standard confirmation messages
|
||||
confirmationSubmitted: (timeout?: number) =>
|
||||
notify({
|
||||
group: "alert",
|
||||
type: "success",
|
||||
title: "Success",
|
||||
text: "Confirmation submitted."
|
||||
}, timeout || TIMEOUTS.STANDARD),
|
||||
confirmationSubmitted: (timeout?: number) =>
|
||||
notify(
|
||||
{
|
||||
group: "alert",
|
||||
type: "success",
|
||||
title: "Success",
|
||||
text: "Confirmation submitted.",
|
||||
},
|
||||
timeout || TIMEOUTS.STANDARD,
|
||||
),
|
||||
|
||||
// Common error patterns
|
||||
genericError: (timeout?: number) =>
|
||||
notify({
|
||||
group: "alert",
|
||||
type: "danger",
|
||||
title: "Error",
|
||||
text: "Something went wrong."
|
||||
}, timeout || TIMEOUTS.LONG),
|
||||
genericError: (timeout?: number) =>
|
||||
notify(
|
||||
{
|
||||
group: "alert",
|
||||
type: "danger",
|
||||
title: "Error",
|
||||
text: "Something went wrong.",
|
||||
},
|
||||
timeout || TIMEOUTS.LONG,
|
||||
),
|
||||
|
||||
// Common success patterns
|
||||
genericSuccess: (timeout?: number) =>
|
||||
notify({
|
||||
group: "alert",
|
||||
type: "success",
|
||||
title: "Success",
|
||||
text: "Operation completed successfully."
|
||||
}, timeout || TIMEOUTS.STANDARD),
|
||||
genericSuccess: (timeout?: number) =>
|
||||
notify(
|
||||
{
|
||||
group: "alert",
|
||||
type: "success",
|
||||
title: "Success",
|
||||
text: "Operation completed successfully.",
|
||||
},
|
||||
timeout || TIMEOUTS.STANDARD,
|
||||
),
|
||||
|
||||
// Common confirmation patterns
|
||||
alreadyConfirmed: (timeout?: number) =>
|
||||
notify({
|
||||
group: "alert",
|
||||
type: "info",
|
||||
title: "Already Confirmed",
|
||||
text: "You already confirmed this claim."
|
||||
}, timeout || TIMEOUTS.STANDARD),
|
||||
alreadyConfirmed: (timeout?: number) =>
|
||||
notify(
|
||||
{
|
||||
group: "alert",
|
||||
type: "info",
|
||||
title: "Already Confirmed",
|
||||
text: "You already confirmed this claim.",
|
||||
},
|
||||
timeout || TIMEOUTS.STANDARD,
|
||||
),
|
||||
|
||||
cannotConfirmIssuer: (timeout?: number) =>
|
||||
notify({
|
||||
group: "alert",
|
||||
type: "info",
|
||||
title: "Cannot Confirm",
|
||||
text: "You cannot confirm this because you issued this claim."
|
||||
}, timeout || TIMEOUTS.STANDARD),
|
||||
cannotConfirmIssuer: (timeout?: number) =>
|
||||
notify(
|
||||
{
|
||||
group: "alert",
|
||||
type: "info",
|
||||
title: "Cannot Confirm",
|
||||
text: "You cannot confirm this because you issued this claim.",
|
||||
},
|
||||
timeout || TIMEOUTS.STANDARD,
|
||||
),
|
||||
|
||||
cannotConfirmHidden: (timeout?: number) =>
|
||||
notify({
|
||||
group: "alert",
|
||||
type: "info",
|
||||
title: "Cannot Confirm",
|
||||
text: "You cannot confirm this because some people are hidden."
|
||||
}, timeout || TIMEOUTS.STANDARD),
|
||||
cannotConfirmHidden: (timeout?: number) =>
|
||||
notify(
|
||||
{
|
||||
group: "alert",
|
||||
type: "info",
|
||||
title: "Cannot Confirm",
|
||||
text: "You cannot confirm this because some people are hidden.",
|
||||
},
|
||||
timeout || TIMEOUTS.STANDARD,
|
||||
),
|
||||
|
||||
notRegistered: (timeout?: number) =>
|
||||
notify({
|
||||
group: "alert",
|
||||
type: "info",
|
||||
title: "Not Registered",
|
||||
text: "Someone needs to register you before you can confirm."
|
||||
}, timeout || TIMEOUTS.STANDARD),
|
||||
notRegistered: (timeout?: number) =>
|
||||
notify(
|
||||
{
|
||||
group: "alert",
|
||||
type: "info",
|
||||
title: "Not Registered",
|
||||
text: "Someone needs to register you before you can confirm.",
|
||||
},
|
||||
timeout || TIMEOUTS.STANDARD,
|
||||
),
|
||||
|
||||
notAGive: (timeout?: number) =>
|
||||
notify({
|
||||
group: "alert",
|
||||
type: "info",
|
||||
title: "Info",
|
||||
text: "This is not a giving action to confirm."
|
||||
}, timeout || TIMEOUTS.STANDARD),
|
||||
notAGive: (timeout?: number) =>
|
||||
notify(
|
||||
{
|
||||
group: "alert",
|
||||
type: "info",
|
||||
title: "Info",
|
||||
text: "This is not a giving action to confirm.",
|
||||
},
|
||||
timeout || TIMEOUTS.STANDARD,
|
||||
),
|
||||
|
||||
// Notification-off modal (for turning off notifications)
|
||||
notificationOff: (
|
||||
title: string,
|
||||
callback: (success: boolean) => Promise<void>,
|
||||
timeout?: number,
|
||||
) =>
|
||||
notify(
|
||||
{
|
||||
group: "modal",
|
||||
type: "notification-off",
|
||||
title,
|
||||
text: "", // unused, only here to satisfy type check
|
||||
callback,
|
||||
},
|
||||
timeout || TIMEOUTS.MODAL,
|
||||
),
|
||||
|
||||
// Download notifications
|
||||
downloadStarted: (format: string = "Dexie", timeout?: number) =>
|
||||
notify(
|
||||
{
|
||||
group: "alert",
|
||||
type: "success",
|
||||
title: "Download Started",
|
||||
text: `See your downloads directory for the backup. It is in the ${format} format.`,
|
||||
},
|
||||
timeout || TIMEOUTS.MODAL,
|
||||
),
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user