Keep toast open on failed extension (#7771)
Co-authored-by: Douwe Osinga <douwe@squareup.com>
This commit is contained in:
@@ -83,6 +83,8 @@ class ToastService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const toastId = 'extension-loading';
|
const toastId = 'extension-loading';
|
||||||
|
const hasErrors = extensions.some((ext) => ext.status === 'error');
|
||||||
|
const autoClose = isComplete && !hasErrors ? 5000 : false;
|
||||||
|
|
||||||
// Check if toast already exists
|
// Check if toast already exists
|
||||||
if (toast.isActive(toastId)) {
|
if (toast.isActive(toastId)) {
|
||||||
@@ -95,7 +97,7 @@ class ToastService {
|
|||||||
isComplete={isComplete}
|
isComplete={isComplete}
|
||||||
/>
|
/>
|
||||||
),
|
),
|
||||||
autoClose: isComplete ? 5000 : false,
|
autoClose,
|
||||||
closeButton: true,
|
closeButton: true,
|
||||||
closeOnClick: false,
|
closeOnClick: false,
|
||||||
});
|
});
|
||||||
@@ -110,7 +112,7 @@ class ToastService {
|
|||||||
{
|
{
|
||||||
...commonToastOptions,
|
...commonToastOptions,
|
||||||
toastId,
|
toastId,
|
||||||
autoClose: isComplete ? 5000 : false,
|
autoClose,
|
||||||
closeButton: true,
|
closeButton: true,
|
||||||
closeOnClick: false, // Prevent closing when clicking to expand/collapse
|
closeOnClick: false, // Prevent closing when clicking to expand/collapse
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user