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
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:
1 parent
2359b80250
commit
d2a319a4d5
45 files changed
+235
-178
No files matched your search
@@ -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
|
||||
|
||||
Reference in new issue
Block a user