Skip to content
This repository was archived by the owner on Jun 24, 2025. It is now read-only.

Commit b809137

Browse files
committed
refactor(text): move license key management to config
1 parent 248f6d6 commit b809137

File tree

2 files changed

+12
-11
lines changed

2 files changed

+12
-11
lines changed

apps/client/src/widgets/type_widgets/ckeditor/config.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ const TEXT_FORMATTING_GROUP = {
1616

1717
export async function buildConfig(): Promise<EditorConfig> {
1818
return {
19+
licenseKey: getLicenseKey(),
1920
image: {
2021
styles: {
2122
options: [
@@ -276,3 +277,13 @@ export function buildFloatingToolbar() {
276277
]
277278
};
278279
}
280+
281+
function getLicenseKey() {
282+
const premiumLicenseKey = import.meta.env.VITE_CKEDITOR_KEY;
283+
if (!premiumLicenseKey) {
284+
logError("CKEditor license key is not set, premium features will not be available.");
285+
return "GPL";
286+
}
287+
288+
return premiumLicenseKey;
289+
}

apps/client/src/widgets/type_widgets/editable_text.ts

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -201,8 +201,7 @@ export default class EditableTextTypeWidget extends AbstractTextTypeWidget {
201201
styles: true,
202202
classes: true,
203203
attributes: true
204-
},
205-
licenseKey: getLicenseKey()
204+
}
206205
};
207206

208207
const contentLanguage = this.note?.getLabelValue("language");
@@ -656,12 +655,3 @@ export default class EditableTextTypeWidget extends AbstractTextTypeWidget {
656655

657656
}
658657

659-
function getLicenseKey() {
660-
const premiumLicenseKey = import.meta.env.VITE_CKEDITOR_KEY;
661-
if (!premiumLicenseKey) {
662-
logError("CKEditor license key is not set, premium features will not be available.");
663-
return "GPL";
664-
}
665-
666-
return premiumLicenseKey;
667-
}

0 commit comments

Comments
 (0)