fix: 启用启动器更新并修复初始化竞态
Axolotl desktop CI / guardrails (push) Has been cancelled
Axolotl desktop CI / desktop (macos-latest) (push) Has been cancelled
Axolotl desktop CI / desktop (ubuntu-latest) (push) Has been cancelled
Axolotl desktop CI / desktop (windows-latest) (push) Has been cancelled
Axolotl desktop CI / website (push) Has been cancelled
Repository checks / typos (push) Has been cancelled
Repository checks / tombi (push) Has been cancelled
Rust checks / shear (push) Has been cancelled
Sync source to CNB / Sync Git ref (push) Has been cancelled

This commit is contained in:
Disy committed 2026-09-26 13:06:51 +08:00
1 parent 2359b80250
commit d2a319a4d5
45 files changed
+235 -178

No files matched your search

+5 -7
View File
@@ -3,11 +3,12 @@ import { FolderOpenIcon, LeftArrowIcon, SparklesIcon } from '@modrinth/assets'
import { BigOptionButton, Button, defineMessages, useVIntl } from '@modrinth/ui'
import { inject, ref, watch } from 'vue'
import { useRouter } from 'vue-router'
import InstanceModeOptions from '@/components/instance/InstanceModeOptions.vue'
import HostedGameDirModal from '@/components/instance/HostedGameDirModal.vue'
import HostedPackProgress from '@/components/instance/HostedPackProgress.vue'
import type { InstanceMode } from '@/helpers/hosted-packs'
import InstanceModeOptions from '@/components/instance/InstanceModeOptions.vue'
import { useHostedCreation } from '@/composables/useHostedCreation'
import type { InstanceMode } from '@/helpers/hosted-packs'
const { formatMessage } = useVIntl()
const router = useRouter()
@@ -187,8 +188,8 @@ function handleImportExisting() {
/>
<BigOptionButton
data-onboarding-id="creation-method-import"
v-if="instanceMode === 'local'"
data-onboarding-id="creation-method-import"
:icon="FolderOpenIcon"
:title="formatMessage(messages.importTitle)"
:description="formatMessage(messages.importDescription)"
@@ -197,10 +198,7 @@ function handleImportExisting() {
/>
</div>
<HostedGameDirModal
ref="hostedGameDirModal"
@confirm="installHostedWithGameDir"
/>
<HostedGameDirModal ref="hostedGameDirModal" @confirm="installHostedWithGameDir" />
<HostedPackProgress :instance-id="createdInstance" :active="installing" />
<p v-if="installError" class="m-0 text-red" role="alert">{{ installError }}</p>
<p v-if="instanceMode === 'local'" class="m-0 text-sm text-secondary">
@@ -259,7 +259,7 @@ onMounted(() => {
/>
<div class="flex flex-col gap-1.5">
<ButtonStyled color="brand">
<button class="start-button" @click="startTranslation" :disabled="!canStart">
<button class="start-button" :disabled="!canStart" @click="startTranslation">
<PlayIcon />{{ formatMessage(messages.start) }}
</button>
</ButtonStyled>
+1 -1
View File
@@ -33,11 +33,11 @@ import {
defineMessages,
DropdownSelect,
injectNotificationManager,
type MessageDescriptor,
PopoutMenu,
Slider,
StyledInput,
Toggle,
type MessageDescriptor,
useRelativeTime,
useVIntl,
} from '@modrinth/ui'
+1 -3
View File
@@ -2,10 +2,9 @@
import { UsersIcon } from '@modrinth/assets'
import { defineMessages, NavTabs, useVIntl } from '@modrinth/ui'
import { computed } from 'vue'
import { RouterView, useRoute, useRouter } from 'vue-router'
import { RouterView, useRouter } from 'vue-router'
const { formatMessage } = useVIntl()
const route = useRoute()
const router = useRouter()
const messages = defineMessages({
@@ -13,7 +12,6 @@ const messages = defineMessages({
roomsTab: { id: 'app.multiplayer.tab.rooms', defaultMessage: 'Rooms' },
})
const activeTab = computed(() => (route.path.startsWith('/multiplayer/rooms') ? 'rooms' : 'rooms'))
const tabLinks = computed(() => [
{ label: formatMessage(messages.roomsTab), href: '/multiplayer/rooms', icon: UsersIcon },
])
+10 -10
View File
@@ -163,7 +163,7 @@
</button>
</ButtonStyled>
<ButtonStyled v-else-if="!isServerInstance" color="brand" size="large">
<button @click="startInstance('InstancePage')">
<button @click="startInstance">
<PlayIcon />
{{ formatMessage(playing ? messages.launchAnother : commonMessages.playButton) }}
</button>
@@ -184,7 +184,7 @@
},
{
id: 'launch_instance',
action: () => startInstance('InstancePage'),
action: startInstance,
},
]"
>
@@ -204,7 +204,7 @@
</ButtonStyled>
</div>
<ButtonStyled v-if="playing" color="red" size="large">
<button :disabled="stopping || loading" @click="stopInstance('InstancePage')">
<button :disabled="stopping || loading" @click="stopInstance">
<StopCircleIcon />
{{ formatMessage(stopping ? messages.stopping : messages.stopAll) }}
</button>
@@ -294,7 +294,7 @@
:is-server-instance="isServerInstance"
:open-settings="() => settingsModal?.show(1)"
@play="updatePlayState"
@stop="() => stopInstance('InstanceSubpage')"
@stop="stopInstance"
></component>
</Suspense>
</template>
@@ -400,9 +400,9 @@ import {
getFreshCachedServerStatus,
} from '@/composables/instances/use-server-status-query'
import { useInstanceConsole } from '@/composables/useInstanceConsole'
import { useInstanceMode } from '@/composables/useInstanceMode'
import { useMinecraftLaunchError } from '@/composables/useMinecraftLaunchError'
import { useNetworkStatus } from '@/composables/useNetworkStatus'
import { useInstanceMode } from '@/composables/useInstanceMode'
import { postUpgradeNoticeQueryKey, usePostUpgradeNotice } from '@/composables/usePostUpgradeNotice'
import { useSymlinkWarningDismiss } from '@/composables/useSymlinkWarningDismiss'
import { get_project_v3 } from '@/helpers/cache.js'
@@ -421,8 +421,8 @@ import {
run,
} from '@/helpers/instance'
import { getDisplayInstanceIcon } from '@/helpers/instance-icons'
import { get_by_instance_id } from '@/helpers/process'
import { isInstanceLaunching } from '@/helpers/instance-launch-state'
import { get_by_instance_id } from '@/helpers/process'
import type { GameInstance } from '@/helpers/types'
import { createInstanceShortcut, showInstanceInFolder } from '@/helpers/utils.js'
import { refreshWorlds, type ServerStatus } from '@/helpers/worlds'
@@ -733,7 +733,7 @@ watch(
const options = ref<InstanceType<typeof ContextMenu> | null>(null)
const startInstance = async (context: string) => {
const startInstance = async () => {
if (!instance.value || loading.value) return
const id = props.id
const name = instance.value.name
@@ -780,7 +780,7 @@ watch(
{ immediate: true },
)
const stopInstance = async (context: string) => {
const stopInstance = async () => {
stopping.value = true
await kill(props.id).catch(handleError)
stopping.value = false
@@ -882,10 +882,10 @@ const handleRightClick = (event: MouseEvent) => {
const handleOptionsClick = async (args: { option: string; item: unknown }) => {
switch (args.option) {
case 'play':
await startInstance('InstancePageContextMenu')
await startInstance()
break
case 'stop':
await stopInstance('InstancePageContextMenu')
await stopInstance()
break
case 'add_content':
await router.push({
@@ -1408,7 +1408,8 @@ async function getUpdaterProjectVersions(
if (!versions) {
versions = (await get_project_versions(projectId).catch(() => null)) as
Labrinth.Versions.v2.Version[] | null
| Labrinth.Versions.v2.Version[]
| null
}
if (!versions && fetchError) {
@@ -1719,9 +1720,6 @@ async function applyToggleDisableBatch(items: ContentItem[], enabled: boolean) {
resultById,
false,
)
for (const operation of operations) {
}
} catch (error) {
for (const operation of operations) {
operation.optimisticPath = operation.originalFilePath
@@ -845,7 +845,7 @@ async function installSelected(fileId: string | null) {
}
if (isWorldMap.value) {
installing.value = true
await installCurseForgeWorld(project.value.id, fileId, instanceId.value, 'ProjectPage', () => {
await installCurseForgeWorld(project.value.id, fileId, instanceId.value, () => {
installing.value = false
}).catch((error) => {
installing.value = false
@@ -414,8 +414,8 @@ import {
ProjectSidebarServerInfo,
ProjectSidebarTags,
requestInstall,
SelectedProjectsFloatingBar,
ScrollToTopButton,
SelectedProjectsFloatingBar,
usesTargetGameVersion,
useVIntl,
} from '@modrinth/ui'
@@ -567,7 +567,7 @@ const messages = defineMessages({
favoritesLoading: {
id: 'app.content-favorites.loading',
defaultMessage: 'Updating favorites…',
},
},
viewDependents: {
id: 'project.actions.view-dependents',
defaultMessage: 'View dependents',
@@ -72,12 +72,7 @@
</template>
<script setup>
import {
CheckIcon,
DownloadIcon,
ExternalIcon,
MoreVerticalIcon,
} from '@modrinth/assets'
import { CheckIcon, DownloadIcon, ExternalIcon, MoreVerticalIcon } from '@modrinth/assets'
import {
ButtonStyled,
commonMessages,
@@ -108,7 +103,7 @@ const messages = defineMessages({
},
})
const props = defineProps({
defineProps({
project: {
type: Object,
default: () => {},