diff --git a/source/github-helpers/toast.tsx b/source/github-helpers/toast.tsx index f86a67a40fef..6f83f84adc2f 100644 --- a/source/github-helpers/toast.tsx +++ b/source/github-helpers/toast.tsx @@ -54,8 +54,6 @@ export default async function showToast( }; const finalUpdateToast = async (message: ToastMessage): Promise => { - updateToast(message); - // Without rAF the toast might be removed before the first page paint // rAF also allows showToast to resolve as soon as task is done await frame(); @@ -95,6 +93,8 @@ export default async function showToast( throw error; } finally { // Use the last message if `false` was passed - void finalUpdateToast(finalToastMessage || lastRawMessage); + const toastMessage = finalToastMessage || lastRawMessage; + updateToast(toastMessage); + void finalUpdateToast(toastMessage); } }