1
1
<script setup lang="ts">
2
+ import type { GameVersion } from ' @modrinth/ui'
2
3
import { GAME_MODES , HeadingLink , injectNotificationManager } from ' @modrinth/ui'
3
4
import type { Dayjs } from ' dayjs'
4
5
import dayjs from ' dayjs'
@@ -10,11 +11,14 @@ import { trackEvent } from '@/helpers/analytics'
10
11
import { process_listener , profile_listener } from ' @/helpers/events'
11
12
import { get_all } from ' @/helpers/process'
12
13
import { kill , run } from ' @/helpers/profile'
14
+ import { get_game_versions } from ' @/helpers/tags'
13
15
import type { GameInstance } from ' @/helpers/types'
14
16
import {
15
17
get_profile_protocol_version ,
16
18
get_recent_worlds ,
17
19
getWorldIdentifier ,
20
+ hasServerQuickPlaySupport ,
21
+ hasWorldQuickPlaySupport ,
18
22
type ProtocolVersion ,
19
23
refreshServerData ,
20
24
type ServerData ,
@@ -37,6 +41,7 @@ const theme = useTheming()
37
41
const jumpBackInItems = ref <JumpBackInItem []>([])
38
42
const serverData = ref <Record <string , ServerData >>({})
39
43
const protocolVersions = ref <Record <string , ProtocolVersion | null >>({})
44
+ const gameVersions = ref <GameVersion []>(await get_game_versions ().catch (() => []))
40
45
41
46
const MIN_JUMP_BACK_IN = 3
42
47
const MAX_JUMP_BACK_IN = 6
@@ -255,7 +260,14 @@ onUnmounted(() => {
255
260
? serverData[item.world.address].refreshing && !serverData[item.world.address].status
256
261
: undefined
257
262
"
258
- supports-quick-play
263
+ :supports-server-quick-play ="
264
+ item.world.type === 'server' &&
265
+ hasServerQuickPlaySupport(gameVersions, item.instance.game_version || '')
266
+ "
267
+ :supports-world-quick-play ="
268
+ item.world.type === 'singleplayer' &&
269
+ hasWorldQuickPlaySupport(gameVersions, item.instance.game_version || '')
270
+ "
259
271
:server-status ="
260
272
item.world.type === 'server' ? serverData[item.world.address].status : undefined
261
273
"
0 commit comments