mirror of
https://git.mirrors.martin98.com/https://github.com/SigNoz/signoz
synced 2025-08-14 15:26:00 +08:00
fix: make the license key check case insensitive (#5331)
* fix: make the license key check case insensitive * fix: added safety checks
This commit is contained in:
parent
873280abea
commit
5df25e83d1
@ -27,6 +27,7 @@ import {
|
||||
import { useSelector } from 'react-redux';
|
||||
import { NavLink } from 'react-router-dom';
|
||||
import { AppState } from 'store/reducers';
|
||||
import { License } from 'types/api/licenses/def';
|
||||
import AppReducer from 'types/reducer/app';
|
||||
import { getFormattedDate, getRemainingDays } from 'utils/timeUtils';
|
||||
|
||||
@ -109,9 +110,13 @@ function HeaderContainer(): JSX.Element {
|
||||
|
||||
const { data: licenseData, isFetching, status: licenseStatus } = useLicense();
|
||||
|
||||
const licensesStatus: string =
|
||||
licenseData?.payload?.licenses?.find((e: License) => e.isCurrent)?.status ||
|
||||
'';
|
||||
|
||||
const isLicenseActive =
|
||||
licenseData?.payload?.licenses?.find((e) => e.isCurrent)?.status ===
|
||||
LICENSE_PLAN_STATUS.VALID;
|
||||
licensesStatus?.toLocaleLowerCase() ===
|
||||
LICENSE_PLAN_STATUS.VALID.toLocaleLowerCase();
|
||||
|
||||
useEffect(() => {
|
||||
if (
|
||||
|
@ -152,9 +152,13 @@ function SideNav({
|
||||
|
||||
const { t } = useTranslation('');
|
||||
|
||||
const licenseStatus: string =
|
||||
licenseData?.payload?.licenses?.find((e: License) => e.isCurrent)?.status ||
|
||||
'';
|
||||
|
||||
const isLicenseActive =
|
||||
licenseData?.payload?.licenses?.find((e: License) => e.isCurrent)?.status ===
|
||||
LICENSE_PLAN_STATUS.VALID;
|
||||
licenseStatus?.toLocaleLowerCase() ===
|
||||
LICENSE_PLAN_STATUS.VALID.toLocaleLowerCase();
|
||||
|
||||
const isEnterprise = licenseData?.payload?.licenses?.some(
|
||||
(license: License) =>
|
||||
|
Loading…
x
Reference in New Issue
Block a user