Bug fixes round 3 (#298)

* fixed bugs

* title case

* bugs; ioerror

* reset breadcrumbs

* more fixes

* more fixes

* scrolling bug

* more fixes

* more fixes

* clippy

* canonicalize fix

* fixed requested changes

* removed debouncer update
This commit is contained in:
Wyatt Verchere
2023-07-19 14:13:25 -07:00
committed by GitHub
parent 6650cc9ce4
commit 1f478ec9fc
34 changed files with 932 additions and 602 deletions

View File

@@ -207,6 +207,7 @@
:dependencies="dependencies"
:install="install"
:installed="installed"
:installing="installing"
:installed-version="installedVersion"
/>
</div>
@@ -310,7 +311,7 @@ async function fetchProjectData() {
useFetch(`https://api.modrinth.com/v2/project/${route.params.id}/members`, 'project'),
useFetch(`https://api.modrinth.com/v2/project/${route.params.id}/dependencies`, 'project'),
get_categories().catch(handleError),
route.query.i ? getInstance(route.query.i, true).catch(handleError) : Promise.resolve(),
route.query.i ? getInstance(route.query.i, false).catch(handleError) : Promise.resolve(),
])
installed.value =
@@ -344,6 +345,7 @@ const markInstalled = () => {
async function install(version) {
installing.value = true
let queuedVersionData
instance.value = await getInstance(instance.value.path, false).catch(handleError)
if (installed.value) {
await remove_project(

View File

@@ -14,10 +14,21 @@
<h2>{{ version.name }}</h2>
</div>
<div class="button-group">
<Button color="primary" :action="() => install(version.id)" :disabled="installed">
<Button
color="primary"
:action="() => install(version.id)"
:disabled="installing || (installed && installedVersion === version.id)"
>
<DownloadIcon v-if="!installed" />
<SwapIcon v-else-if="installedVersion !== version.id" />
<CheckIcon v-else />
{{ installed ? 'Installed' : 'Install' }}
{{
installing
? 'Installing...'
: installed && installedVersion === version.id
? 'Installed'
: 'Install'
}}
</Button>
<Button>
<ReportIcon />
@@ -29,7 +40,7 @@
class="btn"
>
<ExternalIcon />
Modrinth Website
Modrinth website
</a>
</div>
</Card>
@@ -195,6 +206,7 @@ import { releaseColor } from '@/helpers/utils'
import { ref, watch, computed } from 'vue'
import { useRoute } from 'vue-router'
import { useBreadcrumbs } from '@/store/breadcrumbs'
import { SwapIcon } from '@/assets/icons'
const breadcrumbs = useBreadcrumbs()
@@ -225,6 +237,14 @@ const props = defineProps({
type: Boolean,
required: true,
},
installing: {
type: Boolean,
required: true,
},
installedVersion: {
type: String,
required: true,
},
})
const version = ref(props.versions.find((version) => version.id === route.params.version))

View File

@@ -89,7 +89,7 @@
<Button
:color="installed && version.id === installedVersion ? '' : 'primary'"
icon-only
:disabled="installed && version.id === installedVersion"
:disabled="installing || (installed && version.id === installedVersion)"
@click.stop="() => install(version.id)"
>
<DownloadIcon v-if="!installed" />
@@ -191,6 +191,10 @@ const props = defineProps({
type: Boolean,
default: null,
},
installing: {
type: Boolean,
default: false,
},
instance: {
type: Object,
default: null,