fix(api): fix groupNotify

This commit is contained in:
Il Harper 2024-10-05 15:31:02 +08:00
parent d09ac0e040
commit e5d4a3f456
No known key found for this signature in database
GPG Key ID: 4B71FCA698E7E8EC

View File

@ -1,4 +1,4 @@
import { debounce } from 'lodash-es' import { throttle } from 'lodash-es'
import { getSingleScreenNotifies } from '../definitions/groupService' import { getSingleScreenNotifies } from '../definitions/groupService'
const refreshIntl2 = async () => { const refreshIntl2 = async () => {
@ -14,8 +14,13 @@ const refreshIntl2 = async () => {
}) })
} }
const refreshIntl1 = debounce(refreshIntl2, 2000, { // const refreshIntl1 = debounce(refreshIntl2, 2000, {
maxWait: 2000, // maxWait: 2000,
// })
const refreshIntl1 = throttle(refreshIntl2, 4000, {
leading: true,
trailing: false,
}) })
const refresh = () => setTimeout(refreshIntl1, 2000) const refresh = () => setTimeout(refreshIntl1, 2000)