Skip to content

Commit

Permalink
fix: delete img (normaly it works)
Browse files Browse the repository at this point in the history
  • Loading branch information
Suboyyy committed Sep 26, 2024
1 parent 8d092e0 commit 635fff6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/components/dashboard/ItemModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ const ItemModal = ({
const [logo, setLogo] = useState<File | null>(null);
const [display, setDisplay] = useState(item?.display || false);
const [deleteImg, setDeleteImg] = useState(false);
let image = item ? item.image : false;

const [attribute, setAttribute] = useState(item?.attribute || null);
const [category, setCategory] = useState(item?.category || null);
Expand Down Expand Up @@ -63,6 +62,7 @@ const ItemModal = ({
<Button
primary
onClick={() => {
let image;
if ((item?.image || logo) && !deleteImg) {
image = true;
}
Expand Down Expand Up @@ -136,7 +136,7 @@ const ItemModal = ({
<Textarea label="Description" value={infos ?? ''} onChange={setInfos} />
<FileInput
label="Logo"
value={item && image ? getItemImageLink(item.id) : ''}
value={item && item?.image ? getItemImageLink(item.id) : ''}
onChange={setLogo}
type={['png']}
/>
Expand Down

0 comments on commit 635fff6

Please sign in to comment.