This commit is contained in:
Calum H.
2026-03-12 23:09:26 +00:00
committed by GitHub
parent ba06c89a0e
commit 32d76b8025
8 changed files with 39 additions and 14 deletions

View File

@@ -379,7 +379,6 @@ watch(effectiveRequestParams, () => {
}, 200) }, 200)
}) })
async function refreshSearch() { async function refreshSearch() {
const version = ++searchVersion const version = ++searchVersion
debugLog('refreshSearch start', { version, projectType: projectType.value }) debugLog('refreshSearch start', { version, projectType: projectType.value })

View File

@@ -76,10 +76,10 @@ import {
useVIntl, useVIntl,
} from '@modrinth/ui' } from '@modrinth/ui'
import { ContentCardLayout as ContentPageLayout } from '@modrinth/ui' import { ContentCardLayout as ContentPageLayout } from '@modrinth/ui'
import { useDebounceFn } from '@vueuse/core'
import { getCurrentWebview } from '@tauri-apps/api/webview' import { getCurrentWebview } from '@tauri-apps/api/webview'
import { open } from '@tauri-apps/plugin-dialog' import { open } from '@tauri-apps/plugin-dialog'
import { openUrl } from '@tauri-apps/plugin-opener' import { openUrl } from '@tauri-apps/plugin-opener'
import { useDebounceFn } from '@vueuse/core'
import { computed, nextTick, onUnmounted, ref, watch } from 'vue' import { computed, nextTick, onUnmounted, ref, watch } from 'vue'
import { useRouter } from 'vue-router' import { useRouter } from 'vue-router'
@@ -699,8 +699,10 @@ provideContentManager({
getItemId: (item) => item.file_name, getItemId: (item) => item.file_name,
contentTypeLabel: ref(formatMessage(messages.contentTypeProject)), contentTypeLabel: ref(formatMessage(messages.contentTypeProject)),
toggleEnabled: toggleDisableMod, toggleEnabled: toggleDisableMod,
bulkEnableItems: (items) => Promise.all(items.map((item) => toggleDisableMod(item))).then(() => {}), bulkEnableItems: (items) =>
bulkDisableItems: (items) => Promise.all(items.map((item) => toggleDisableMod(item))).then(() => {}), Promise.all(items.map((item) => toggleDisableMod(item))).then(() => {}),
bulkDisableItems: (items) =>
Promise.all(items.map((item) => toggleDisableMod(item))).then(() => {}),
deleteItem: removeMod, deleteItem: removeMod,
bulkDeleteItems: (items) => Promise.all(items.map((item) => removeMod(item))).then(() => {}), bulkDeleteItems: (items) => Promise.all(items.map((item) => removeMod(item))).then(() => {}),
refresh: () => initProjects('must_revalidate'), refresh: () => initProjects('must_revalidate'),
@@ -725,17 +727,16 @@ provideContentManager({
title: item.file_name.replace('.disabled', ''), title: item.file_name.replace('.disabled', ''),
icon_url: null, icon_url: null,
}, },
projectLink: item.project?.id projectLink: item.project?.id ? `/project/${item.project.id}` : undefined,
? `/project/${item.project.id}`
: undefined,
version: item.version ?? { version: item.version ?? {
id: item.file_name, id: item.file_name,
version_number: formatMessage(messages.unknownVersion), version_number: formatMessage(messages.unknownVersion),
file_name: item.file_name, file_name: item.file_name,
}, },
versionLink: item.project?.id && item.version?.id versionLink:
? `/project/${item.project.id}/version/${item.version.id}` item.project?.id && item.version?.id
: undefined, ? `/project/${item.project.id}/version/${item.version.id}`
: undefined,
owner: item.owner owner: item.owner
? { ? {
...item.owner, ...item.owner,

View File

@@ -465,7 +465,10 @@ export function createContentInstall(opts: {
await installVersionDependencies( await installVersionDependencies(
instance, instance,
version, version,
(depProject: Labrinth.Projects.v2.Project, depVersion?: Labrinth.Versions.v2.Version) => { (
depProject: Labrinth.Projects.v2.Project,
depVersion?: Labrinth.Versions.v2.Version,
) => {
addInstallingItem(instancePath, depProject, depVersion) addInstallingItem(instancePath, depProject, depVersion)
installedProjectIds.push(depProject.id) installedProjectIds.push(depProject.id)
}, },

View File

@@ -98,7 +98,10 @@ const fileNameRef = ref<HTMLElement | null>(null)
/> />
<div class="flex min-w-0 items-center gap-3"> <div class="flex min-w-0 items-center gap-3">
<div v-tooltip="installing ? formatMessage(commonMessages.installingLabel) : undefined" class="relative shrink-0"> <div
v-tooltip="installing ? formatMessage(commonMessages.installingLabel) : undefined"
class="relative shrink-0"
>
<Avatar <Avatar
:src="project.icon_url" :src="project.icon_url"
:alt="project.title" :alt="project.title"

View File

@@ -284,7 +284,9 @@ function handleSort(column: ContentCardTableSortColumn) {
'border-0 border-t border-solid border-surface-4', 'border-0 border-t border-solid border-surface-4',
visibleRange.start + idx === items.length - 1 && !flat ? 'rounded-b-[20px]' : '', visibleRange.start + idx === items.length - 1 && !flat ? 'rounded-b-[20px]' : '',
]" ]"
@update:selected="(val) => toggleItemSelection(item.id, val ?? false, visibleRange.start + idx)" @update:selected="
(val) => toggleItemSelection(item.id, val ?? false, visibleRange.start + idx)
"
@update:enabled="(val) => emit('update:enabled', item.id, val)" @update:enabled="(val) => emit('update:enabled', item.id, val)"
@delete="emit('delete', item.id)" @delete="emit('delete', item.id)"
@update="emit('update', item.id)" @update="emit('update', item.id)"

View File

@@ -187,7 +187,9 @@ export function useInlineBackup(backupName: string | (() => string)) {
text: 'The backup has been cancelled. You can create a new one or proceed without a backup.', text: 'The backup has been cancelled. You can create a new one or proceed without a backup.',
}) })
} catch { } catch {
isBackingUp.value = false
isCancelling.value = false isCancelling.value = false
backupFailed.value = true
} }
} }

View File

@@ -665,7 +665,7 @@ async function handleModpackUpdate() {
addNotification({ addNotification({
type: 'error', type: 'error',
title: formatMessage(messages.failedToLoadVersions), title: formatMessage(messages.failedToLoadVersions),
text: err instanceof Error ? err.message : undefined, text: err instanceof Error ? err.message : undefined,
}) })
} finally { } finally {
loadingVersions.value = false loadingVersions.value = false

View File

@@ -506,6 +506,18 @@
"header.category.resolutions": { "header.category.resolutions": {
"defaultMessage": "Resolution" "defaultMessage": "Resolution"
}, },
"hosting.content.failed-to-bulk-delete": {
"defaultMessage": "Failed to delete content"
},
"hosting.content.failed-to-bulk-disable": {
"defaultMessage": "Failed to disable content"
},
"hosting.content.failed-to-bulk-enable": {
"defaultMessage": "Failed to enable content"
},
"hosting.content.failed-to-bulk-update": {
"defaultMessage": "Failed to update content"
},
"hosting.content.failed-to-load-modpack-content": { "hosting.content.failed-to-load-modpack-content": {
"defaultMessage": "Failed to load modpack content" "defaultMessage": "Failed to load modpack content"
}, },
@@ -893,6 +905,9 @@
"label.installed-modpack": { "label.installed-modpack": {
"defaultMessage": "Installed modpack" "defaultMessage": "Installed modpack"
}, },
"label.installing": {
"defaultMessage": "Installing..."
},
"label.loading": { "label.loading": {
"defaultMessage": "Loading..." "defaultMessage": "Loading..."
}, },