From 371a47d83808b13f99b226d77d1b943f1fba6dc6 Mon Sep 17 00:00:00 2001 From: Aman Harwara Date: Sat, 7 Jan 2023 14:47:17 +0530 Subject: [PATCH] refactor: new note default editor options --- .../Utils/DropdownItemsForEditors.ts | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/packages/web/src/javascripts/Utils/DropdownItemsForEditors.ts b/packages/web/src/javascripts/Utils/DropdownItemsForEditors.ts index 850737313..623ae8c29 100644 --- a/packages/web/src/javascripts/Utils/DropdownItemsForEditors.ts +++ b/packages/web/src/javascripts/Utils/DropdownItemsForEditors.ts @@ -1,4 +1,4 @@ -import { FeatureIdentifier } from '@standardnotes/snjs' +import { FeatureIdentifier, FeatureStatus } from '@standardnotes/snjs' import { ComponentArea, NoteType } from '@standardnotes/features' import { WebApplication } from '@/Application/Application' import { PlainEditorMetadata, SuperEditorMetadata } from '@/Constants/Constants' @@ -46,13 +46,15 @@ export function getDropdownItemsForAllEditors(application: WebApplication): Edit options.push(plaintextOption) - options.push({ - icon: SuperEditorMetadata.icon, - iconClassName: SuperEditorMetadata.iconClassName, - label: SuperEditorMetadata.name, - value: FeatureIdentifier.SuperEditor, - isLabs: true, - }) + if (application.features.getFeatureStatus(FeatureIdentifier.SuperEditor) === FeatureStatus.Entitled) { + options.push({ + icon: SuperEditorMetadata.icon, + iconClassName: SuperEditorMetadata.iconClassName, + label: SuperEditorMetadata.name, + value: FeatureIdentifier.SuperEditor, + isLabs: true, + }) + } options.sort((a, b) => { return a.label.toLowerCase() < b.label.toLowerCase() ? -1 : 1