style: run prettier

pull/9743/head
Konstantinos Kaloutas 2023-06-28 17:19:21 +03:00
parent c17dd5fa31
commit 249a9dc688
3 changed files with 8 additions and 8 deletions

View File

@ -42,9 +42,9 @@ interface Asset extends TLAsset {
}
const assetExtensions = {
'image': ['.png', '.svg', '.jpg', '.jpeg', '.gif'],
'video': ['.mp4', '.webm', '.ogg'],
'pdf': ['.pdf']
image: ['.png', '.svg', '.jpg', '.jpeg', '.gif'],
video: ['.mp4', '.webm', '.ogg'],
pdf: ['.pdf'],
}
function getFileType(filename: string) {
@ -53,7 +53,9 @@ function getFileType(filename: string) {
if (!extensionMatch) return 'unknown'
const extension = extensionMatch[0].toLowerCase()
const [type, _extensions] = Object.entries(assetExtensions).find(([_type, extensions]) => extensions.includes(extension)) ?? ['unknown', null]
const [type, _extensions] = Object.entries(assetExtensions).find(([_type, extensions]) =>
extensions.includes(extension)
) ?? ['unknown', null]
return type
}

View File

@ -30,9 +30,7 @@ export class PdfShape extends TLBoxShape<PdfShapeProps> {
ReactComponent = observer(({ events, asset, isErasing, isEditing }: TLComponentProps) => {
const ref = React.useRef<HTMLElement>(null)
const {
handlers,
} = React.useContext(LogseqContext)
const { handlers } = React.useContext(LogseqContext)
const app = useApp<Shape>()
const isMoving = useCameraMovingRef()

View File

@ -101,7 +101,7 @@ export function getSizeFromSrc(dataURL: string, type: string): Promise<number[]>
img.onload = () => resolve([img.width, img.height])
img.src = dataURL
img.onerror = err => reject(err)
} else if(type === 'pdf'){
} else if (type === 'pdf') {
resolve([595, 842]) // A4 portrait dimensions at 72 ppi
}
})