This commit is contained in:
429Enjoyer committed 2026-05-13 08:49:42 +07:00
1 parent 84b067ebd4
commit e67d09a248
47 files changed
+3688 -958

No files matched your search

+6 -6
View File
@@ -1,4 +1,4 @@
import { toast } from "sonner";
import { toast, type ExternalToast } from "sonner";
import { playSuccessSound, playErrorSound, playWarningSound, playInfoSound, } from "./audio";
import { logger } from "./logger";
import { getSettings } from "./settings";
@@ -7,35 +7,35 @@ const toastStyle = {
};
const isSfxEnabled = () => getSettings().sfxEnabled;
export const toastWithSound = {
success: (message: string, data?: any) => {
success: (message: string, data?: ExternalToast) => {
const msg = message.toLowerCase();
logger.success(msg);
if (isSfxEnabled())
playSuccessSound();
return toast.success(msg, { ...toastStyle, ...data });
},
error: (message: string, data?: any) => {
error: (message: string, data?: ExternalToast) => {
const msg = message.toLowerCase();
logger.error(msg);
if (isSfxEnabled())
playErrorSound();
return toast.error(msg, { ...toastStyle, ...data });
},
warning: (message: string, data?: any) => {
warning: (message: string, data?: ExternalToast) => {
const msg = message.toLowerCase();
logger.warning(msg);
if (isSfxEnabled())
playWarningSound();
return toast.warning(msg, { ...toastStyle, ...data });
},
info: (message: string, data?: any) => {
info: (message: string, data?: ExternalToast) => {
const msg = message.toLowerCase();
logger.info(msg);
if (isSfxEnabled())
playInfoSound();
return toast.info(msg, { ...toastStyle, ...data });
},
message: (message: string, data?: any) => {
message: (message: string, data?: ExternalToast) => {
const msg = message.toLowerCase();
logger.info(msg);
if (isSfxEnabled())