mirror of
https://github.com/go-gitea/gitea.git
synced 2026-09-06 21:13:24 +09:00
enhance(web): show attachment URL and UUID in dropzone preview (#39203)
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
This commit is contained in:
co-authored by
wxiaoguang
parent
eb501f6b19
commit
bde1af541c
+2
-2
@@ -173,11 +173,11 @@ export function sleep(ms: number): Promise<void> {
|
||||
return new Promise((resolve) => setTimeout(resolve, ms));
|
||||
}
|
||||
|
||||
export function isImageFile({name, type}: {name?: string, type?: string}): boolean {
|
||||
export function isImageFile({name, type}: {name: string | null, type: string | null}): boolean {
|
||||
return Boolean(/\.(avif|jpe?g|png|gif|webp|svg|heic)$/i.test(name || '') || type?.startsWith('image/'));
|
||||
}
|
||||
|
||||
export function isVideoFile({name, type}: {name?: string, type?: string}): boolean {
|
||||
export function isVideoFile({name, type}: {name: string | null, type: string | null}): boolean {
|
||||
return Boolean(/\.(mpe?g|mp4|mkv|webm)$/i.test(name || '') || type?.startsWith('video/'));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user