File tree Expand file tree Collapse file tree 2 files changed +3
-2
lines changed
application/client/src/app Expand file tree Collapse file tree 2 files changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -94,5 +94,5 @@ export interface Clipboard {
9494 * @param mime - MIME type of the data (e.g. `text/plain`, `image/png`).
9595 * @param data - Content as an ArrayBuffer.
9696 */
97- write ( mime : string , data : ArrayBuffer ) : Promise < void > ;
97+ write ( mime : string | undefined , data : ArrayBuffer ) : Promise < void > ;
9898}
Original file line number Diff line number Diff line change @@ -206,13 +206,14 @@ export class Preview extends ChangesDetector implements AfterViewInit, AfterCont
206206 this . log ( ) . warn ( `Fail to fetch image as Blob` ) ;
207207 return ;
208208 }
209+ const contentType = response . type . trim ( ) ;
209210 response
210211 . arrayBuffer ( )
211212 . then ( ( buffer ) => {
212213 // We are using native clipboard API, but not browser one (navigator.clipboard)
213214 // to avoid possible issues with size of blob.
214215 window . electron . clipboard
215- . write ( response . type || 'application/octet-stream' , buffer )
216+ . write ( contentType . length > 0 ? contentType : undefined , buffer )
216217 . catch ( ( err : Error ) => {
217218 this . log ( ) . warn (
218219 `Fail to copy image into clipboard: ${ err . message } ` ,
You can’t perform that action at this time.
0 commit comments