Skip to content

Commit

Permalink
Minor change
Browse files Browse the repository at this point in the history
  • Loading branch information
mgesing committed May 14, 2019
1 parent 6d5b2d4 commit 469a749
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
Binary file modified lib/SmartStore.Licensing/SmartStore.Licensing.dll
Binary file not shown.
Expand Up @@ -102,30 +102,30 @@ private LicensingData PrepareLicenseLabelModel(LicenseLabelModel model, PluginDe
model.IsLicensable = true;
model.LicenseUrl = Url.Action("LicensePlugin", new { systemName = pluginDescriptor.SystemName });

var license = LicenseChecker.GetLicense(pluginDescriptor.SystemName, url);
if (license == null)
var cachedLicense = LicenseChecker.GetLicense(pluginDescriptor.SystemName, url);
if (cachedLicense == null)
{
// Licensed plugin has not been used yet -> Check state.
var unused = LicenseChecker.CheckState(pluginDescriptor.SystemName, url);
// Licensed plugin has not been used yet -> Check state.
model.LicenseState = LicenseChecker.CheckState(pluginDescriptor.SystemName, url);

// And try to get license data again.
license = LicenseChecker.GetLicense(pluginDescriptor.SystemName, url);
cachedLicense = LicenseChecker.GetLicense(pluginDescriptor.SystemName, url);
}

if (license != null)
if (cachedLicense != null)
{
// Licensed plugin has been used.
model.LicenseState = license.State;
model.TruncatedLicenseKey = license.TruncatedLicenseKey;
model.RemainingDemoUsageDays = license.RemainingDemoDays;
model.LicenseState = cachedLicense.State;
model.TruncatedLicenseKey = cachedLicense.TruncatedLicenseKey;
model.RemainingDemoUsageDays = cachedLicense.RemainingDemoDays;
}
else
{
// It's confusing to display a license state when there is no license data yet.
model.HideLabel = true;
}

return license;
return cachedLicense;
}

return null;
Expand Down

0 comments on commit 469a749

Please sign in to comment.