Fix "Clear Image" button (#1249)

* Fix "Clear Image" button (Performer Edit)
* Fix "Clear Image" button (New Performer)
* Fix "Clear Image" button (Edit Studio)
* Fix "Clear Image" button (Edit Tag)
This commit is contained in:
peolic 2021-04-09 07:41:28 +03:00 committed by GitHub
parent 4462b3cc8e
commit 60af076fff
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 4 additions and 3 deletions

View file

@ -11,5 +11,6 @@
* Change performer text query to search by name and alias only.
### 🐛 Bug fixes
* Fix `Clear Image` button not updating image preview.
* Fix processing some webp files.
* Fix incorrect performer age calculation in UI.

View file

@ -47,7 +47,7 @@ export const Performer: React.FC = () => {
const activeImage =
imagePreview === undefined
? performer.image_path ?? ""
: imagePreview ?? `${performer.image_path}?default=true`;
: imagePreview ?? (isNew ? "" : `${performer.image_path}&default=true`);
const lightboxImages = useMemo(
() => [{ paths: { thumbnail: activeImage, image: activeImage } }],
[activeImage]

View file

@ -231,7 +231,7 @@ export const Studio: React.FC = () => {
function onClearImage() {
setImage(null);
setImagePreview(
studio.image_path ? `${studio.image_path}?default=true` : undefined
studio.image_path ? `${studio.image_path}&default=true` : undefined
);
}

View file

@ -204,7 +204,7 @@ export const Tag: React.FC = () => {
function onClearImage() {
setImage(null);
setImagePreview(
tag?.image_path ? `${tag.image_path}?default=true` : undefined
tag?.image_path ? `${tag.image_path}&default=true` : undefined
);
}