chore: add image loading error handling (#532)
This commit is contained in:
@@ -137,3 +137,10 @@ export function renderPitchContour(options: {
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
export function imgErrorToDefalut(e: React.SyntheticEvent<HTMLImageElement, Event>) {
|
||||
const target = e.target as HTMLImageElement;
|
||||
target.onerror = null;
|
||||
target.src = "assets/default-img.jpg";
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user