fix;合并修复问题
This commit is contained in:
@@ -0,0 +1,23 @@
|
||||
export type PartnerToastVariant = 'success' | 'error';
|
||||
|
||||
type PartnerToastListener = (message: string, variant: PartnerToastVariant) => void;
|
||||
|
||||
let listener: PartnerToastListener | null = null;
|
||||
|
||||
export function registerPartnerToastListener(fn: PartnerToastListener | null) {
|
||||
listener = fn;
|
||||
}
|
||||
|
||||
export function showPartnerToast(message: string, variant: PartnerToastVariant = 'error') {
|
||||
const text = message.trim();
|
||||
if (!text || !listener) return;
|
||||
listener(text, variant);
|
||||
}
|
||||
|
||||
export function toastError(message: string) {
|
||||
showPartnerToast(message, 'error');
|
||||
}
|
||||
|
||||
export function toastSuccess(message: string) {
|
||||
showPartnerToast(message, 'success');
|
||||
}
|
||||
Reference in New Issue
Block a user