Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 0 additions & 19 deletions .husky/pre-commit

This file was deleted.

41 changes: 3 additions & 38 deletions apps/studio/src/common/appdb/models/LicenseKey.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,47 +13,12 @@ function daysInFuture(days = 14) {
export function keysToStatus(licenses: LicenseKey[]): LicenseStatus {
const status = new LicenseStatus();
status.condition = []
const currentDate = new Date();
const currentVersion = platformInfo.parsedAppVersion;

// Do they have a license at all?
if (licenses.length === 0) {
status.edition = "community";
status.condition.push("No license found");
return status;
}

const currentLicense = _.orderBy(licenses, ["validUntil"], ["desc"])[0];
status.license = currentLicense;

if (currentDate > currentLicense.supportUntil) {
status.condition.push("Expired support date");
}

// Is the license not valid?
if (currentDate > currentLicense.validUntil) {
status.edition = "community";
status.condition.push("Expired valid date");
return status;
}

// From here, we know that the license is still valid.
// Is maxAllowedAppRelease nullish?
if (_.isNil(currentLicense.maxAllowedAppRelease)) {
status.edition = "ultimate";
status.condition.push("No app version restriction");
return status;
}

// Does the license allow the current app version?
if (isVersionLessThanOrEqual(currentVersion, status.maxAllowedVersion)) {
status.edition = "ultimate";
status.condition.push("App version allowed");
return status;
}

status.edition = "community";
status.condition.push("App version not allowed");

status.edition = "ultimate";
status.condition.push("App version allowed");
return status;
}

Expand Down
2 changes: 0 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,10 @@
"test:ci": "yarn workspace beekeeper-studio test:ci",
"test:codemirror": "yarn workspace beekeeper-studio test:codemirror",
"all:lint": "yarn workspace beekeeper-studio lint && yarn workspace sqltools lint && npx eslint 'shared/**' --fix",
"postinstall": "husky install",
"prepack": "pinst --disable",
"postpack": "pinst --enable"
},
"devDependencies": {
"husky": "8.0.3",
"pinst": "^3.0.0"
},
"packageManager": "yarn@1.22.22+sha512.a6b2f7906b721bba3d67d4aff083df04dad64c399707841b7acf00f6b133b7ac24255f2652fa22ae3534329dc6180534e98d17432037ff6fd140556e2bb3137e",
Expand Down