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 #1227 #1228

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 10 additions & 10 deletions theseus_gui/src/components/ui/URLConfirmModal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -11,30 +11,30 @@ import ModInstallModal from '@/components/ui/ModInstallModal.vue'

const confirmModal = ref(null)
const project = ref(null)
const version = ref(null)
const versions = ref(null)
const categories = ref(null)
const installing = ref(false)
const modInstallModal = ref(null)

defineExpose({
async show(event) {
if (event.event === 'InstallVersion') {
version.value = await useFetch(
versions.value[0] = await useFetch(
`https://api.modrinth.com/v2/version/${encodeURIComponent(event.id)}`,
'version',
)
project.value = await useFetch(
`https://api.modrinth.com/v2/project/${encodeURIComponent(version.value.project_id)}`,
`https://api.modrinth.com/v2/project/${encodeURIComponent(versions.value[0].project_id)}`,
'project',
)
} else {
project.value = await useFetch(
`https://api.modrinth.com/v2/project/${encodeURIComponent(event.id)}`,
'project',
)
version.value = await useFetch(
`https://api.modrinth.com/v2/version/${encodeURIComponent(project.value.versions[0])}`,
'version',
versions.value = await useFetch(
`https://api.modrinth.com/v2/project/${encodeURIComponent(event.id)}/version`,
'project versions',
)
}
categories.value = (await get_categories().catch(handleError)).filter(
Expand All @@ -53,21 +53,21 @@ async function install() {
if (project.value.project_type === 'modpack') {
await packInstall(
project.value.id,
version.value.id,
versions.value[0].id,
project.value.title,
project.value.icon_url,
).catch(handleError)

mixpanel.track('PackInstall', {
id: project.value.id,
version_id: version.value.id,
version_id: versions.value[0].id,
title: project.value.title,
source: 'ProjectPage',
})
} else {
modInstallModal.value.show(
project.value.id,
[version.value],
versions.value,
project.value.title,
project.value.project_type,
)
Expand All @@ -87,7 +87,7 @@ async function install() {
<div class="button-row">
<div class="markdown-body">
<p>
Installing <code>{{ version.id }}</code> from Modrinth
Installing <code>{{ project.id }}</code> from Modrinth
</p>
</div>
<div class="button-group">
Expand Down