Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions source/github-helpers/toast.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,6 @@ export default async function showToast(
};

const finalUpdateToast = async (message: ToastMessage): Promise<void> => {
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();
Expand Down Expand Up @@ -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);
}
}