-
Notifications
You must be signed in to change notification settings - Fork 277
feat(frontend): Store last selected game version and platform for download modal #3284
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
base: main
Are you sure you want to change the base?
feat(frontend): Store last selected game version and platform for download modal #3284
Conversation
Stores selected game version and platform(modloader) in localStorage to retrive them when download modal openned
Signed-off-by: Denis <[email protected]>
30a24fb
to
9fdac5a
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR enhances the download modal by persisting the last user-selected game version and platform using localStorage. Key changes include:
- Replacing ButtonStyled blocks with Accordions for game version and platform selection.
- Introducing helper functions (setSelectedGameVersion and setSelectedPlatform) to update both reactive refs and localStorage.
- Loading persisted selections on the client when the page is loaded.
Comments suppressed due to low confidence (2)
apps/frontend/src/pages/[type]/[id].vue:328
- Confirm that changing this condition from v-else-if to v-if does not inadvertently render the platform Accordion for resourcepack projects, potentially affecting the intended download flow.
v-if="project.project_type !== 'resourcepack'"
apps/frontend/src/pages/[type]/[id].vue:880
- [nitpick] Ensure that using localStorage with the keys 'selected_game_version' and 'selected_platform' is consistent with the application standards, and consider any necessary type handling for stored values.
if (import.meta.client) {
@@ -1009,7 +979,18 @@ const licenseIdDisplay = computed(() => { | |||
return id; | |||
} | |||
}); | |||
|
|||
function setSelectedGameVersion(version) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nitpick] Consider adding inline documentation for the new setSelectedGameVersion and setSelectedPlatform functions to clarify their role in persisting user selections.
Copilot uses AI. Check for mistakes.
Stores last user selected game version and platform (aka modloader) to retrive them before openning download modal.
Resolves #2332
PS: It's my first contribution to modrinth. I'm sorry if i did smth wrong