mirror of
https://github.com/ikun0014/lx-music-mobile.git
synced 2025-07-04 23:38:55 +08:00
修复更新弹窗设置无效的问题
This commit is contained in:
parent
f5a4784bb2
commit
c9632160e0
@ -25,7 +25,8 @@ export const addUserApi = (info: LX.UserApi.UserApiInfo) => {
|
||||
export const setUserApiAllowShowUpdateAlert = (id: string, enable: boolean) => {
|
||||
const targetIndex = state.list.findIndex(api => api.id == id)
|
||||
if (targetIndex < 0) return
|
||||
state.list.splice(targetIndex, 1, { ...state.list[targetIndex], allowShowUpdateAlert: enable })
|
||||
state.list[targetIndex].allowShowUpdateAlert = enable
|
||||
state.list.splice(targetIndex, 1, { ...state.list[targetIndex] })
|
||||
|
||||
event.list_changed([...state.list])
|
||||
}
|
||||
|
@ -84,6 +84,8 @@ export const onScriptAction = (handler: (event: ActionsEvent) => void): () => vo
|
||||
if (event.action == 'init') {
|
||||
if (event.data.info) event.data.info = { ...loadScriptInfo, ...event.data.info }
|
||||
else event.data.info = { ...loadScriptInfo }
|
||||
} else if (event.action == 'showUpdateAlert') {
|
||||
if (!loadScriptInfo?.allowShowUpdateAlert) return
|
||||
}
|
||||
handler(event as ActionsEvent)
|
||||
})
|
||||
|
Loading…
x
Reference in New Issue
Block a user