Merge pull request #873 from LaurenceJJones/fix-default-image-delete

fix: hide delete overlay for default app images
This commit is contained in:
Jannis Mattheis 2025-11-16 11:41:52 +01:00 committed by GitHub
commit 2a6f9fbc7c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 6 additions and 1 deletions

View File

@ -431,6 +431,7 @@ func (a *ApplicationAPI) RemoveApplicationImage(ctx *gin.Context) {
func withResolvedImage(app *model.Application) *model.Application {
if app.Image == "" {
// This must stay in sync with the isDefaultImage check in ui/src/application/Applications.tsx.
app.Image = "static/defaultapp.png"
} else {
app.Image = "image/" + app.Image

View File

@ -197,12 +197,16 @@ const Row = ({
fEdit,
}: IRowProps) => {
const {classes} = useStyles();
const isDefaultImage = image === 'static/defaultapp.png';
return (
<TableRow>
<TableCell padding="normal">
<div style={{display: 'flex'}}>
<Tooltip title="Delete image" placement="top" arrow>
<ButtonBase className={classes.imageContainer} onClick={fDeleteImage}>
<ButtonBase
className={classes.imageContainer}
onClick={fDeleteImage}
disabled={isDefaultImage}>
<img
src={config.get('url') + image}
alt="app logo"