File tree Expand file tree Collapse file tree 1 file changed +11
-12
lines changed
src/dashboard/Data/Browser Expand file tree Collapse file tree 1 file changed +11
-12
lines changed Original file line number Diff line number Diff line change @@ -842,18 +842,17 @@ export default class DataBrowser extends React.Component {
842842 }
843843
844844 urls . forEach ( url => {
845- try {
846- if ( mediaType === 'image' ) {
847- const img = new Image ( ) ;
848- img . src = url ;
849- } else if ( mediaType === 'video' || mediaType === 'audio' ) {
850- // For video and audio, we can use fetch to cache the content
851- fetch ( url , { mode : 'no-cors' } ) . catch ( ( ) => {
852- // Silently fail - the media will load normally if prefetch fails
853- } ) ;
854- }
855- } catch ( error ) {
856- // Silently fail - the media will load normally if prefetch fails
845+ if ( mediaType === 'image' ) {
846+ const img = new Image ( ) ;
847+ img . onerror = ( ) => {
848+ console . error ( `Failed to prefetch image: ${ url } ` ) ;
849+ } ;
850+ img . src = url ;
851+ } else if ( mediaType === 'video' || mediaType === 'audio' ) {
852+ // For video and audio, we can use fetch to cache the content
853+ fetch ( url , { mode : 'no-cors' } ) . catch ( error => {
854+ console . error ( `Failed to prefetch ${ mediaType } : ${ url } ` , error ) ;
855+ } ) ;
857856 }
858857 } ) ;
859858 }
You can’t perform that action at this time.
0 commit comments