RocketChat/Rocket.Chat

View on GitHub
ee/packages/license/src/events/deprecated.ts

Summary

Maintainability
A
0 mins
Test Coverage
import type { LicenseModule } from '@rocket.chat/core-typings';

import type { LicenseManager } from '../license';
import { hasModule } from '../modules';

// #TODO: Remove this onLicense handler
export function onLicense(this: LicenseManager, feature: LicenseModule, cb: (...args: any[]) => void): void | Promise<void> {
    if (hasModule.call(this, feature)) {
        return cb();
    }

    this.once(`valid:${feature}`, cb);
}