Skip to content

Commit

Permalink
Revert "init"
Browse files Browse the repository at this point in the history
This reverts commit fb23b20.
  • Loading branch information
thomasneirynck committed Jan 14, 2021
1 parent fc47b82 commit 9ff82de
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 17 deletions.
24 changes: 9 additions & 15 deletions x-pack/plugins/maps/public/licensed_features.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,23 +54,17 @@ export function registerLicensedFeatures(licensingPlugin: LicensingPluginSetup)
}

let licensingPluginStart: LicensingPluginStart;
export function setLicensingPluginStart(licensingPlugin: LicensingPluginStart) {
licensingPluginStart = licensingPlugin;
licensingPluginStart.license$.subscribe((license: ILicense) => {
const gold = license.check(APP_ID, 'gold');
isGoldPlus = gold.state === 'valid';

function updateLicenseState(license: ILicense) {
const gold = license.check(APP_ID, 'gold');
isGoldPlus = gold.state === 'valid';

const enterprise = license.check(APP_ID, 'enterprise');
isEnterprisePlus = enterprise.state === 'valid';

licenseId = license.uid;
}

export async function setLicensingPluginStart(licensingPlugin: LicensingPluginStart) {
const license = await licensingPlugin.refresh();
updateLicenseState(license);
const enterprise = license.check(APP_ID, 'enterprise');
isEnterprisePlus = enterprise.state === 'valid';

licensingPluginStart = licensingPlugin;
licensingPluginStart.license$.subscribe(updateLicenseState);
licenseId = license.uid;
});
}

export function notifyLicensedFeatureUsage(licensedFeature: LICENSED_FEATURES) {
Expand Down
4 changes: 2 additions & 2 deletions x-pack/plugins/maps/public/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -158,8 +158,8 @@ export class MapsPlugin
});
}

public async start(core: CoreStart, plugins: MapsPluginStartDependencies): Promise<MapsStartApi> {
await setLicensingPluginStart(plugins.licensing);
public start(core: CoreStart, plugins: MapsPluginStartDependencies): MapsStartApi {
setLicensingPluginStart(plugins.licensing);
plugins.uiActions.addTriggerAction(VISUALIZE_GEO_FIELD_TRIGGER, visualizeGeoFieldAction);
setStartServices(core, plugins);
// unregisters the OSS alias
Expand Down

0 comments on commit 9ff82de

Please sign in to comment.