Overwrite new performer image after clearing current image (#1321)

This commit is contained in:
peolic 2021-04-21 07:19:40 +03:00 committed by GitHub
parent 79a180ba73
commit 1767390e0d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 2 deletions

View file

@ -24,6 +24,7 @@
* Change performer text query to search by name and alias only.
### 🐛 Bug fixes
* Fix scraped performer image not updating after clearing the current image when creating a new performer.
* Fix error preventing adding a new library path when an existing library path is missing.
* Fix whitespace in query string returning all objects.
* Fix hang on Login page when not connected to internet.

View file

@ -311,9 +311,10 @@ export const PerformerEditPanel: React.FC<IPerformerDetails> = ({
// image is a base64 string
// #404: don't overwrite image if it has been modified by the user
// overwrite if not new since it came from a dialog
// otherwise follow existing behaviour
// overwrite if image was cleared (`null`)
// otherwise follow existing behaviour (`undefined`)
if (
(!isNew || formik.values.image === undefined) &&
(!isNew || [null, undefined].includes(formik.values.image)) &&
state.image !== undefined
) {
const imageStr = state.image;