-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[license] Updated the LicenseInfo
class with 2 additional checks
#16404
base: master
Are you sure you want to change the base?
[license] Updated the LicenseInfo
class with 2 additional checks
#16404
Conversation
Deploy preview: https://deploy-preview-16404--material-ui-x.netlify.app/ |
Co-authored-by: Sam Sycamore <[email protected]> Signed-off-by: Michel Engelen <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
couple more little nitpicks here but otherwise I think this is good to go
Co-authored-by: Sam Sycamore <[email protected]> Signed-off-by: Michel Engelen <[email protected]>
Co-authored-by: Sam Sycamore <[email protected]> Signed-off-by: Michel Engelen <[email protected]>
if (!LicenseInfo.getHasSetLicenseKeyRun()) { | ||
showSetLicenseKeyNotCalledError(); | ||
} | ||
if (!LicenseInfo.getIsLicenseKeySet()) { | ||
showLicenseKeyNotSetError(); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The error looks out of place, I got the impression that LICENSE_STATUS
is meant for this.
LicenseInfo.isLicenseKeySet = !!key; | ||
LicenseInfo.hasSetLicenseKeyRun = true; | ||
} | ||
|
||
public static getIsLicenseKeySet(): boolean { | ||
return LicenseInfo.isLicenseKeySet; | ||
} | ||
|
||
public static getHasSetLicenseKeyRun(): boolean { | ||
return LicenseInfo.hasSetLicenseKeyRun; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We could do this with less code, no?
LicenseInfo.isLicenseKeySet = !!key; | |
LicenseInfo.hasSetLicenseKeyRun = true; | |
} | |
public static getIsLicenseKeySet(): boolean { | |
return LicenseInfo.isLicenseKeySet; | |
} | |
public static getHasSetLicenseKeyRun(): boolean { | |
return LicenseInfo.hasSetLicenseKeyRun; | |
} |
and then
ponyfillGlobal.__MUI_LICENSE_INFO__ = ponyfillGlobal.__MUI_LICENSE_INFO__ || {
- key: undefined,
+ key: 'default',
};
this adds 2 additional checks to the license check.
setLicenseKey
method been run at allasking @mapache-salvaje specifically for a review of the error messages 🙇🏼