File tree Expand file tree Collapse file tree
MaiChartManager/Front/src/views/ModManager Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11import api from "@/client/api" ;
22import { useAsyncState } from '@vueuse/core' ;
33import { computed , ref } from 'vue' ;
4+ import { debounce } from 'perfect-debounce' ;
45import { ConfigDto } from "@/client/apiGen" ;
5- import { modInfo } from "@/store/refs" ;
6+ import { globalCapture , modInfo , updateModInfo } from "@/store/refs" ;
67import { compareVersions } from "./shouldShowUpdateController" ;
78
89// 请求参数 ref
@@ -70,7 +71,14 @@ export const updateAquaMaiConfig = async (forceDefault = false, skipSignatureChe
7071export const muModChannel = computed ( ( ) => modInfo . value ?. muModChannel ?? 'slow' ) ;
7172export const isBothModsPresent = computed ( ( ) => ! ! modInfo . value ?. isBothModsPresent ) ;
7273
73- export const updateMuModChannel = async ( channel : string ) => {
74- await api . SetMuModChannelAndEnsureCache ( { channel } ) ;
75- await updateAquaMaiConfig ( ) ;
74+ const updateMuModChannelImpl = async ( channel : string ) => {
75+ try {
76+ await api . SetMuModChannelAndEnsureCache ( { channel } ) ;
77+ await updateModInfo ( ) ;
78+ await updateAquaMaiConfig ( ) ;
79+ } catch ( e : any ) {
80+ globalCapture ( e , 'mod.cacheFailed' ) ;
81+ }
7682} ;
83+
84+ export const updateMuModChannel = debounce ( updateMuModChannelImpl , 1500 ) ;
You can’t perform that action at this time.
0 commit comments