8
0
فهرست منبع

Removing image on abort and error if not already removed.

Szymon Kupś 8 سال پیش
والد
کامیت
b139869ef6
1فایلهای تغییر یافته به همراه8 افزوده شده و 0 حذف شده
  1. 8 0
      packages/ckeditor5-upload/src/imageuploadengine.js

+ 8 - 0
packages/ckeditor5-upload/src/imageuploadengine.js

@@ -130,6 +130,14 @@ export default class ImageUploadEngine extends Plugin {
 					notification.showWarning( msg, { namespace: 'upload' } );
 				}
 
+				// Remove Image if not in graveyard already.
+				// Abort is called on image removal too so prevent from removing image twice.
+				if ( imageElement.root.rootName !== '$graveyard' ) {
+					doc.enqueueChanges( () => {
+						batch.remove( imageElement );
+					} );
+				}
+
 				clean();
 			} );