fix ToastType enum (#3201)

Co-authored-by: v <vendicated@riseup.net>
This commit is contained in:
Suffocate 2025-02-06 20:04:59 +00:00 committed by GitHub
parent 4a447c74ef
commit e4380632e0
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 12 additions and 7 deletions

View file

@ -60,7 +60,7 @@ export async function downloadSettingsBackup() {
} }
} }
const toast = (type: number, message: string) => const toast = (type: string, message: string) =>
Toasts.show({ Toasts.show({
type, type,
message, message,

View file

@ -71,10 +71,15 @@ export let Alerts: t.Alerts;
waitFor(["show", "close"], m => Alerts = m); waitFor(["show", "close"], m => Alerts = m);
const ToastType = { const ToastType = {
MESSAGE: 0, MESSAGE: "message",
SUCCESS: 1, SUCCESS: "success",
FAILURE: 2, FAILURE: "failure",
CUSTOM: 3 CUSTOM: "custom",
CLIP: "clip",
LINK: "link",
FORWARD: "forward",
BOOKMARK: "bookmark",
CLOCK: "clock"
}; };
const ToastPosition = { const ToastPosition = {
TOP: 0, TOP: 0,
@ -87,7 +92,7 @@ export interface ToastData {
/** /**
* Toasts.Type * Toasts.Type
*/ */
type: number, type: string,
options?: ToastOptions; options?: ToastOptions;
} }
@ -110,7 +115,7 @@ export const Toasts = {
...{} as { ...{} as {
show(data: ToastData): void; show(data: ToastData): void;
pop(): void; pop(): void;
create(message: string, type: number, options?: ToastOptions): ToastData; create(message: string, type: string, options?: ToastOptions): ToastData;
} }
}; };