fix pasting svg from clipboard (#884)

This commit is contained in:
Judicael 2022-08-04 23:43:57 +03:00 committed by GitHub
parent 7fce946428
commit c527e0547b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1765,9 +1765,8 @@ export class TldrawApp extends StateManager<TDSnapshot> {
paste = async (point?: number[], e?: ClipboardEvent) => {
if (this.readOnly) return
const shapesToCreate: TDShape[] = []
const filesToPaste: File[] = []
const shapesToCreate: TDShape[] = []
let clipboardData: any
@ -1855,11 +1854,10 @@ export class TldrawApp extends StateManager<TDSnapshot> {
}
case 'text/plain': {
if (str.startsWith('<svg')) {
getSvgFromText(str)
await getSvgFromText(str)
} else {
getShapeFromText(str)
}
// return
break
}
}