♻️ (index.tsx): remove unnecessary trailing commas to improve code readability

🐛 (index.tsx): fix conditional rendering of Download option in toolbar
✨ (ProfilePictureForm): add setLoading(false) after updating state to ensure loading state is reset
This commit is contained in:
cristhianzl 2024-06-12 19:43:41 -03:00
commit 45963ffce0
2 changed files with 16 additions and 12 deletions

View file

@ -625,7 +625,7 @@ export default function NodeToolbarComponent({
/> />
</SelectItem> </SelectItem>
)} )}
{(!hasStore || !hasApiKey || !validApiKey) && ( {/* {(!hasStore || !hasApiKey || !validApiKey) && (
<SelectItem value={"Download"}> <SelectItem value={"Download"}>
<ToolbarSelectItem <ToolbarSelectItem
shortcut={ shortcut={
@ -637,7 +637,7 @@ export default function NodeToolbarComponent({
dataTestId="Download-button-modal" dataTestId="Download-button-modal"
/> />
</SelectItem> </SelectItem>
)} )} */}
<SelectItem <SelectItem
value={"documentation"} value={"documentation"}
disabled={data.node?.documentation === ""} disabled={data.node?.documentation === ""}
@ -687,16 +687,19 @@ export default function NodeToolbarComponent({
style={`${frozen ? " text-ice" : ""} transition-all`} style={`${frozen ? " text-ice" : ""} transition-all`}
/> />
</SelectItem> </SelectItem>
<SelectItem value="Download"> {(!hasStore || !hasApiKey || !validApiKey) && (
<ToolbarSelectItem <SelectItem value="Download">
shortcut={ <ToolbarSelectItem
shortcuts.find((obj) => obj.name === "Download")?.shortcut! shortcut={
} shortcuts.find((obj) => obj.name === "Download")
value={"Download"} ?.shortcut!
icon={"Download"} }
dataTestId="download-button-modal" value={"Download"}
/> icon={"Download"}
</SelectItem> dataTestId="download-button-modal"
/>
</SelectItem>
)}
<SelectItem <SelectItem
value={"delete"} value={"delete"}
className="focus:bg-red-400/[.20]" className="focus:bg-red-400/[.20]"

View file

@ -45,6 +45,7 @@ const ProfilePictureFormComponent = ({
} else { } else {
prev[folder] = [path]; prev[folder] = [path];
} }
setLoading(false);
return prev; return prev;
}); });
}); });