diff --git a/src/utils/settingsSync.ts b/src/utils/settingsSync.ts index f19928ac4..6ec3e527a 100644 --- a/src/utils/settingsSync.ts +++ b/src/utils/settingsSync.ts @@ -60,7 +60,7 @@ export async function downloadSettingsBackup() { } } -const toast = (type: number, message: string) => +const toast = (type: string, message: string) => Toasts.show({ type, message, diff --git a/src/webpack/common/utils.ts b/src/webpack/common/utils.ts index 1bdf236ac..fe0668885 100644 --- a/src/webpack/common/utils.ts +++ b/src/webpack/common/utils.ts @@ -71,10 +71,15 @@ export let Alerts: t.Alerts; waitFor(["show", "close"], m => Alerts = m); const ToastType = { - MESSAGE: 0, - SUCCESS: 1, - FAILURE: 2, - CUSTOM: 3 + MESSAGE: "message", + SUCCESS: "success", + FAILURE: "failure", + CUSTOM: "custom", + CLIP: "clip", + LINK: "link", + FORWARD: "forward", + BOOKMARK: "bookmark", + CLOCK: "clock" }; const ToastPosition = { TOP: 0, @@ -87,7 +92,7 @@ export interface ToastData { /** * Toasts.Type */ - type: number, + type: string, options?: ToastOptions; } @@ -110,7 +115,7 @@ export const Toasts = { ...{} as { show(data: ToastData): void; pop(): void; - create(message: string, type: number, options?: ToastOptions): ToastData; + create(message: string, type: string, options?: ToastOptions): ToastData; } };