mirror of
https://github.com/modrinth/code.git
synced 2026-09-04 22:10:15 +00:00
fix: qa
This commit is contained in:
@@ -907,17 +907,18 @@ function getCardActions(
|
|||||||
const isQueued = queuedServerInstallProjectIds.value.has(projectResult.project_id)
|
const isQueued = queuedServerInstallProjectIds.value.has(projectResult.project_id)
|
||||||
const isQueuedRoot = queuedServerInstallRootProjectIds.value.has(projectResult.project_id)
|
const isQueuedRoot = queuedServerInstallRootProjectIds.value.has(projectResult.project_id)
|
||||||
const isInstallingSelection = isInstallingQueuedServerInstalls.value
|
const isInstallingSelection = isInstallingQueuedServerInstalls.value
|
||||||
|
const showAsInstalling = isInstalling || (isInstallingSelection && isQueuedRoot)
|
||||||
const validatingInstall =
|
const validatingInstall =
|
||||||
isInstalling && currentProjectType !== 'modpack' && !isInstallingSelection
|
isInstalling && currentProjectType !== 'modpack' && !isInstallingSelection
|
||||||
const installLabel = showAsInstalled
|
const installLabel = showAsInstalled
|
||||||
? commonMessages.installedLabel
|
? commonMessages.installedLabel
|
||||||
: isQueued
|
: isQueued
|
||||||
? isInstalling || isInstallingSelection
|
? showAsInstalling
|
||||||
? validatingInstall
|
? validatingInstall
|
||||||
? commonMessages.validatingLabel
|
? commonMessages.validatingLabel
|
||||||
: messages.installingToServer
|
: messages.installingToServer
|
||||||
: commonMessages.selectedLabel
|
: commonMessages.selectedLabel
|
||||||
: isInstalling || isInstallingSelection
|
: showAsInstalling
|
||||||
? validatingInstall
|
? validatingInstall
|
||||||
? commonMessages.validatingLabel
|
? commonMessages.validatingLabel
|
||||||
: messages.installingToServer
|
: messages.installingToServer
|
||||||
@@ -927,15 +928,15 @@ function getCardActions(
|
|||||||
key: 'install',
|
key: 'install',
|
||||||
label: formatMessage(installLabel),
|
label: formatMessage(installLabel),
|
||||||
icon:
|
icon:
|
||||||
isInstalling || isInstallingSelection
|
showAsInstalling
|
||||||
? SpinnerIcon
|
? SpinnerIcon
|
||||||
: isQueued || showAsInstalled
|
: isQueued || showAsInstalled
|
||||||
? CheckIcon
|
? CheckIcon
|
||||||
: PlusIcon,
|
: PlusIcon,
|
||||||
iconClass: isInstalling || isInstallingSelection ? 'animate-spin' : undefined,
|
iconClass: showAsInstalling ? 'animate-spin' : undefined,
|
||||||
disabled:
|
disabled:
|
||||||
showAsInstalled || isInstalling || isInstallingSelection || (isQueued && !isQueuedRoot),
|
showAsInstalled || isInstalling || isInstallingSelection || (isQueued && !isQueuedRoot),
|
||||||
color: isQueued && !isInstalling && !isInstallingSelection ? 'green' : 'brand',
|
color: isQueued && !showAsInstalling ? 'green' : 'brand',
|
||||||
type: 'outlined',
|
type: 'outlined',
|
||||||
onClick: async () => {
|
onClick: async () => {
|
||||||
if (isQueuedRoot) {
|
if (isQueuedRoot) {
|
||||||
|
|||||||
@@ -361,17 +361,18 @@ function getCardActions(
|
|||||||
serverData.value.upstream?.project_id === result.project_id
|
serverData.value.upstream?.project_id === result.project_id
|
||||||
const isInstalling = installingProjectIds.value.has(result.project_id)
|
const isInstalling = installingProjectIds.value.has(result.project_id)
|
||||||
const isInstallingSelection = isInstallingQueuedServerInstalls.value
|
const isInstallingSelection = isInstallingQueuedServerInstalls.value
|
||||||
|
const showAsInstalling = isInstalling || (isInstallingSelection && isQueuedRoot)
|
||||||
const validatingInstall =
|
const validatingInstall =
|
||||||
isInstalling && currentProjectType !== 'modpack' && !isInstallingSelection
|
isInstalling && currentProjectType !== 'modpack' && !isInstallingSelection
|
||||||
const installLabel = isInstalled
|
const installLabel = isInstalled
|
||||||
? formatMessage(commonMessages.installedLabel)
|
? formatMessage(commonMessages.installedLabel)
|
||||||
: isQueued
|
: isQueued
|
||||||
? isInstalling || isInstallingSelection
|
? showAsInstalling
|
||||||
? validatingInstall
|
? validatingInstall
|
||||||
? formatMessage(commonMessages.validatingLabel)
|
? formatMessage(commonMessages.validatingLabel)
|
||||||
: formatMessage(commonMessages.installingLabel)
|
: formatMessage(commonMessages.installingLabel)
|
||||||
: formatMessage(commonMessages.selectedLabel)
|
: formatMessage(commonMessages.selectedLabel)
|
||||||
: isInstalling || isInstallingSelection
|
: showAsInstalling
|
||||||
? validatingInstall
|
? validatingInstall
|
||||||
? formatMessage(commonMessages.validatingLabel)
|
? formatMessage(commonMessages.validatingLabel)
|
||||||
: formatMessage(commonMessages.installingLabel)
|
: formatMessage(commonMessages.installingLabel)
|
||||||
@@ -382,15 +383,15 @@ function getCardActions(
|
|||||||
key: 'install',
|
key: 'install',
|
||||||
label: installLabel,
|
label: installLabel,
|
||||||
icon:
|
icon:
|
||||||
isInstalling || isInstallingSelection
|
showAsInstalling
|
||||||
? SpinnerIcon
|
? SpinnerIcon
|
||||||
: isQueued || isInstalled
|
: isQueued || isInstalled
|
||||||
? CheckIcon
|
? CheckIcon
|
||||||
: DownloadIcon,
|
: DownloadIcon,
|
||||||
iconClass: isInstalling || isInstallingSelection ? 'animate-spin' : undefined,
|
iconClass: showAsInstalling ? 'animate-spin' : undefined,
|
||||||
disabled:
|
disabled:
|
||||||
!!isInstalled || isInstalling || isInstallingSelection || (isQueued && !isQueuedRoot),
|
!!isInstalled || isInstalling || isInstallingSelection || (isQueued && !isQueuedRoot),
|
||||||
color: isQueued && !isInstalling && !isInstallingSelection ? 'green' : 'brand',
|
color: isQueued && !showAsInstalling ? 'green' : 'brand',
|
||||||
type: 'outlined',
|
type: 'outlined',
|
||||||
onClick: () => serverInstall(projectResult),
|
onClick: () => serverInstall(projectResult),
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user