-
-
Notifications
You must be signed in to change notification settings - Fork 188
Closed
Labels
Description
Hi! 👋
Firstly, thanks for your work on this project! 🙂
Today I used patch-package to patch @base-ui-components/[email protected]
for the project I'm working on.
Here is the diff that solved my problem:
diff --git a/node_modules/@base-ui-components/react/esm/toast/provider/ToastProvider.js b/node_modules/@base-ui-components/react/esm/toast/provider/ToastProvider.js
index d30a3d2..94b8fe7 100644
--- a/node_modules/@base-ui-components/react/esm/toast/provider/ToastProvider.js
+++ b/node_modules/@base-ui-components/react/esm/toast/provider/ToastProvider.js
@@ -218,21 +218,23 @@ export const ToastProvider = function ToastProvider(props) {
type: 'loading'
});
const handledPromise = promiseValue.then(result => {
+ const successOptions = resolvePromiseOptions(options.success, result);
update(id, {
- ...resolvePromiseOptions(options.success, result),
+ ...successOptions,
type: 'success'
});
- scheduleTimer(id, timeout, () => close(id));
+ scheduleTimer(id, successOptions.timeout ?? timeout, () => close(id));
if (hoveringRef.current || focusedRef.current || !windowFocusedRef.current) {
pauseTimers();
}
return result;
}).catch(error => {
+ const errorOptions = resolvePromiseOptions(options.error, error);
update(id, {
- ...resolvePromiseOptions(options.error, error),
+ ...errorOptions,
type: 'error'
});
- scheduleTimer(id, timeout, () => close(id));
+ scheduleTimer(id, errorOptions.timeout ?? timeout, () => close(id));
if (hoveringRef.current || focusedRef.current || !windowFocusedRef.current) {
pauseTimers();
}
This issue body was partially generated by patch-package.
Metadata
Metadata
Assignees
Labels
Projects
Status
Done