@@ -6,6 +6,7 @@ import {useDisplay} from "vuetify";
66import {useGlobalStore } from " @/stores/global" ;
77import ImgTag from " @/components/ImgTag.vue" ;
88import VideoPlayer from " @/components/VideoPlayer.vue" ;
9+ import {blobFileList } from " @/composables/syncing" ;
910
1011const value = defineModel <any >({ required: true });
1112const {
@@ -40,12 +41,15 @@ const thumbnailSize = (file: IFile): { width: number, height: number } => {
4041 };
4142}
4243const isImage = (file : IFile ): boolean => {
43- return file .meta .type .startsWith (' image/' );
44+ return file .meta .type ? .startsWith (' image/' ) || false ;
4445}
4546const isVideo = (file : IFile ): boolean => {
46- return file .meta .type .startsWith (' video/' );
47+ return file .meta .type ? .startsWith (' video/' ) || false ;
4748}
4849const src = computed ((): string => {
50+ if (file .path && blobFileList [file .path ]) {
51+ return blobFileList [file .path ];
52+ }
4953 if (file .path && (file .path .startsWith (' http://' ) || file .path .startsWith (' https://' ))) {
5054 return file .path ;
5155 }
@@ -60,7 +64,7 @@ const onDownloadFile = (file: IFile) => {
6064 .then (blob => {
6165 const link = document .createElement (' a' );
6266 link .href = URL .createObjectURL (blob );
63- link .download = file .meta .originalFileName ;
67+ link .download = file .meta .originalFileName || ' unknown ' ;
6468 document .body .appendChild (link );
6569 link .click ();
6670 document .body .removeChild (link );
@@ -155,12 +159,11 @@ const onRemoveFile = (file: IFile) => {
155159 v-bind =" props"
156160 :disabled =" disabled"
157161 :size =" smAndDown ? 'small' : 'default'"
158- color =" error"
159162 variant =" text"
160163 icon
161164 @click =" () => onRemoveFile(file)"
162165 >
163- <v-icon icon =" mdi-trash-can-outline " />
166+ <v-icon icon =" mdi-close " />
164167 </v-btn >
165168 </template >
166169 </v-tooltip >
0 commit comments