fix(plugins/staff-settings): use wait api instead of find

This commit is contained in:
PalmDevs 2025-05-01 18:22:12 +07:00
parent 75154b77e8
commit 743353d20e
No known key found for this signature in database
GPG key ID: 6FAE8F8677ACA8BA

View file

@ -1,4 +1,4 @@
import { findModule } from '@revenge-mod/modules/finders'
import { waitForModules } from '@revenge-mod/modules/finders'
import { byProps } from '@revenge-mod/modules/finders/filters'
import { after } from '@revenge-mod/patcher'
@ -15,9 +15,11 @@ registerPlugin(
icon: 'StaffBadgeIcon',
},
{
async init({ cleanup }) {
const UserStoreUtils = await findModule(byProps('isStaffEnv'))
cleanup(after(UserStoreUtils, 'isStaffEnv', () => true))
init({ cleanup }) {
const unsub = waitForModules(byProps('isStaffEnv'), (_, UserStoreUtils) => {
unsub()
cleanup(after(UserStoreUtils, 'isStaffEnv', () => true))
})
},
},
PluginFlags.Enabled,