mirror of
https://github.com/trafficlunar/tomodachi-share.git
synced 2026-06-28 14:44:15 +00:00
fix: can't edit custom images properly
also cleanup
This commit is contained in:
parent
a5080f1b2e
commit
913f0ef65a
5 changed files with 35 additions and 53 deletions
|
|
@ -50,6 +50,11 @@ export default function EditForm({ mii, likes }: Props) {
|
|||
const session = useSession();
|
||||
const [files, setFiles] = useState<FileWithPath[]>([]);
|
||||
|
||||
const handleFilesChange: React.Dispatch<React.SetStateAction<FileWithPath[]>> = (updater) => {
|
||||
hasCustomImagesChanged.current = true;
|
||||
setFiles(updater);
|
||||
};
|
||||
|
||||
const handleDrop = useCallback(
|
||||
(acceptedFiles: FileWithPath[]) => {
|
||||
if (files.length >= 3) return;
|
||||
|
|
@ -439,7 +444,7 @@ export default function EditForm({ mii, likes }: Props) {
|
|||
</Dropzone>
|
||||
</div>
|
||||
|
||||
<ImageList files={files} setFiles={setFiles} />
|
||||
<ImageList files={files} setFiles={handleFilesChange} />
|
||||
|
||||
<hr className="border-zinc-300 my-2" />
|
||||
<div className="flex justify-between items-center">
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue