Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

QoL Improvements #654

Merged
merged 10 commits into from
Oct 24, 2023
Merged

Conversation

ElementalCrisis
Copy link
Member

No description provided.

<>
<Link
className="font-semibold text-panel-text-primary"
to={`/webui/collection/group/${series.IDs?.ParentGroup}`}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think ?.ParentGroup check needs to be moved into group.Size > 1 condition otherwise you will be rendering a broken link which doesn't make a lot of sense.

Copy link
Member

@harshithmohan harshithmohan Oct 23, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

group will be empty if ParentGroup doesn't exist because the query will be skipped. So it doesn't matter.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I mean if you anticipate that ${series.IDs?.ParentGroup} might be null then just move it to the line 109 and don't try to render a link at all if you are unable to make a valid route anyways.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think the optional chaining there is needed as every series will always have a parent group. Its why I added the group.Size check in the first place since without it, you could go into the group for single series.

image

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There, I fixed it 👍
IDs will always exist so there was no point in putting the ? anyway

@hidden4003 hidden4003 merged commit 66aafb0 into ShokoAnime:master Oct 24, 2023
@ElementalCrisis ElementalCrisis deleted the QoL-Improvements branch December 26, 2023 07:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants