Memoize toasts to unstick them in AudioCapture

This commit is contained in:
Josh Perez 2021-10-12 15:09:00 -04:00 committed by GitHub
parent f4b0bade80
commit 7488fa5abc
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 85 additions and 77 deletions

View file

@ -134,9 +134,9 @@ export const AudioCapture = ({
completeRecording(conversationId, onSendAudioRecording);
}, [conversationId, completeRecording, onSendAudioRecording]);
function closeToast() {
const closeToast = useCallback(() => {
setToastType(undefined);
}
}, []);
let toastElement: JSX.Element | undefined;
if (toastType === ToastType.VoiceNoteLimit) {