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({
type,
message,

View file

@ -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;
}
};