Commit 54b9161d authored by Paul Kaplan's avatar Paul Kaplan

fix(studio): prevent duplicate submissions on studio project browser modal

parent e835cafc
...@@ -10,6 +10,7 @@ const UserProjectsTile = ({id, title, image, inStudio, onAdd, onRemove}) => { ...@@ -10,6 +10,7 @@ const UserProjectsTile = ({id, title, image, inStudio, onAdd, onRemove}) => {
const [added, setAdded] = useState(inStudio); const [added, setAdded] = useState(inStudio);
const {errorAlert} = useContext(AlertContext); const {errorAlert} = useContext(AlertContext);
const toggle = () => { const toggle = () => {
if (submitting) return;
setSubmitting(true); setSubmitting(true);
const adding = !added; // for clarity, the current action is opposite of previous state const adding = !added; // for clarity, the current action is opposite of previous state
(adding ? onAdd(id) : onRemove(id)) (adding ? onAdd(id) : onRemove(id))
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment