@@ -41,9 +41,18 @@ export function compareVersions(v1: string, v2: string) {
4141
4242export const selectedChannel = useStorage < 'slow' | 'ci' > ( 'aquamai-update-channel' , 'slow' ) ;
4343
44+ // MuMod 模式:MuMod 已安装且没有冲突(两者都不存在的情况不算 MuMod 模式)
45+ export const isMuModMode = computed ( ( ) => {
46+ return ! ! modInfo . value ?. muModInstalled && ! modInfo . value ?. isBothModsPresent ;
47+ } ) ;
48+
4449export const latestVersion = computed ( ( ) => {
50+ // MuMod 模式下,使用 muModChannel 对应的 API type 查找最新版本
51+ const effectiveChannel = isMuModMode . value
52+ ? ( modInfo . value ?. muModChannel === 'fast' ? 'ci' : 'slow' )
53+ : selectedChannel . value ;
4554 const defaultVersionInfo =
46- modUpdateInfo . value ?. find ( it => it . type === selectedChannel . value ) ||
55+ modUpdateInfo . value ?. find ( it => it . type === effectiveChannel ) ||
4756 modUpdateInfo . value ?. find ( it => it . default ) ||
4857 modUpdateInfo . value ?. [ 0 ] || { type : 'builtin' } ;
4958 if ( defaultVersionInfo . type === "builtin" ) {
@@ -52,9 +61,9 @@ export const latestVersion = computed(() => {
5261 type : 'builtin' ,
5362 } ;
5463 }
55- let latestVersion = defaultVersionInfo . version ! ;
64+ let latestVersionStr = defaultVersionInfo . version ! ;
5665 let builtinVersion = modInfo . value ! . bundledAquaMaiVersion ! ;
57- if ( compareVersions ( latestVersion , builtinVersion ) < 0 ) {
66+ if ( compareVersions ( latestVersionStr , builtinVersion ) < 0 ) {
5867 return {
5968 version : builtinVersion ,
6069 type : 'builtin' ,
@@ -63,11 +72,6 @@ export const latestVersion = computed(() => {
6372 return defaultVersionInfo ;
6473} )
6574
66- // MuMod 模式:MuMod 已安装且没有冲突(两者都不存在的情况不算 MuMod 模式)
67- export const isMuModMode = computed ( ( ) => {
68- return ! ! modInfo . value ?. muModInstalled && ! modInfo . value ?. isBothModsPresent ;
69- } ) ;
70-
7175export const shouldShowUpdate = computed ( ( ) => {
7276 if ( isMuModMode . value ) {
7377 // MuMod 模式下:比较缓存版本和最新版本
0 commit comments