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

Fix indirect link toggling #8308

Merged
merged 3 commits into from
Jan 24, 2023
Merged

Fix indirect link toggling #8308

merged 3 commits into from
Jan 24, 2023

Conversation

JammingBen
Copy link
Contributor

Description

Toggling indirect links in the sidebar (as well as the broken sidebar state with public links with pnpm vite) has been fixed.

Related Issue

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Technical debt
  • Tests

@JammingBen JammingBen self-assigned this Jan 24, 2023
!store.getters.configuration.options.sidebar.shares.showAllOnLoad
)
Copy link
Member

Choose a reason for hiding this comment

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

Does this really work? Just wrapping a value in ref() shouldn't make it reactive I thought, doesnt this need to be wrapped in computed()?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This works, yes. My idea was to make it mutable, because it needs to be written. showAllOnLoad is just the initial value.

Copy link
Member

Choose a reason for hiding this comment

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

Sounds legit @JammingBen we indeed don't want to mutate the config option in the store. using it as initial value and not persist the change in memory is a good solution. well spotted though @dschmidt I also had the same raised eyebrow feeling.

Copy link
Member

Choose a reason for hiding this comment

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

Ah, one idea for improvement though:

Suggested change
)
const indirectLinkListCollapsed = ref(linkListeCollapsed)

Otherwise you have the same store reference twice in consecutive lines.

Copy link
Member

@kulmann kulmann left a comment

Choose a reason for hiding this comment

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

👍

@sonarcloud
Copy link

sonarcloud bot commented Jan 24, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

100.0% 100.0% Coverage
0.0% 0.0% Duplication

@JammingBen JammingBen merged commit 48c7449 into master Jan 24, 2023
@delete-merged-branch delete-merged-branch bot deleted the fix-indirect-link-toggling branch January 24, 2023 14:30
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.

Sidebar is broken for resources with public links with pnpm vite Indirect links can't be expanded
3 participants