Ensure multiple draft attachment adds don't stomp on each other
This commit is contained in:
parent
c822c45310
commit
4b6832bba5
2 changed files with 26 additions and 3 deletions
|
@ -8,6 +8,7 @@ import {
|
|||
} from './processAttachment';
|
||||
import type { AttachmentType } from '../types/Attachment';
|
||||
import { AttachmentToastType } from '../types/AttachmentToastType';
|
||||
import * as log from '../logging/log';
|
||||
|
||||
export type AddAttachmentActionType = (
|
||||
conversationId: string,
|
||||
|
@ -74,6 +75,10 @@ export async function handleAttachmentsProcessing({
|
|||
}
|
||||
addAttachment(conversationId, attachment);
|
||||
} catch (err) {
|
||||
log.error(
|
||||
'handleAttachmentsProcessing: failed to process attachment:',
|
||||
err.stack
|
||||
);
|
||||
removeAttachment(conversationId, file.path);
|
||||
onShowToast(AttachmentToastType.ToastUnableToLoadAttachment);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue