feat(frontend): Automatically open download modal when filter queries are present (on the main mod page) (#3133)

* feat: Automatically open download modal when filter queries are present

* chore: Use a hash to open the modal, and make the filter queries independent of the modal
This commit is contained in:
Awakened Redstone 2025-01-09 21:45:23 -03:00 committed by GitHub
parent 6266f29b99
commit 316fe72ea5
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1247,6 +1247,23 @@ if (!route.name.startsWith("type-id-settings")) {
const onUserCollectProject = useClientTry(userCollectProject);
const {version, loader} = route.query;
if (version !== undefined && project.value.game_versions.includes(version)) {
userSelectedGameVersion.value = version;
}
if (loader !== undefined && project.value.loaders.includes(loader)) {
userSelectedPlatform.value = loader;
}
watch(downloadModal, (modal) => {
if (!modal) return;
// route.hash returns everything in the hash string, including the # itself
if (route.hash === "#download") {
modal.show();
}
})
async function setProcessing() {
startLoading();