diff --git a/apps/mobile/app/screens/editor/tiptap/use-editor-events.tsx b/apps/mobile/app/screens/editor/tiptap/use-editor-events.tsx index 6ef136b02..79c5b0683 100644 --- a/apps/mobile/app/screens/editor/tiptap/use-editor-events.tsx +++ b/apps/mobile/app/screens/editor/tiptap/use-editor-events.tsx @@ -80,6 +80,7 @@ import { EditorMessage, EditorProps, useEditorType } from "./types"; import { useTabStore } from "./use-tab-store"; import { editorState, openInternalLink } from "./utils"; import AddReminder from "../../add-reminder"; +import { useAreFeaturesAvailable } from "@notesnook/common"; const publishNote = async () => { const user = useUserStore.getState().user; @@ -148,6 +149,11 @@ export const useEditorEvents = ( editor: useEditorType, { readonly: editorPropReadonly, noHeader, noToolbar }: Partial ) => { + const features = useAreFeaturesAvailable([ + "callout", + "outlineList", + "taskList" + ]); const deviceMode = useSettingStore((state) => state.deviceMode); const fullscreen = useSettingStore((state) => state.fullscreen); const corsProxy = useSettingStore((state) => state.settings.corsProxy); @@ -216,7 +222,8 @@ export const useEditorEvents = ( dateFormat: db.settings?.getDateFormat(), timeFormat: db.settings?.getTimeFormat(), fontScale, - markdownShortcuts + markdownShortcuts, + features }); }, [ fullscreen, @@ -235,7 +242,8 @@ export const useEditorEvents = ( timeFormat, loading, fontScale, - markdownShortcuts + markdownShortcuts, + features ]); const onBackPress = useCallback(async () => { diff --git a/packages/editor-mobile/src/components/editor.tsx b/packages/editor-mobile/src/components/editor.tsx index 02e9b7d57..dbf6cb5d7 100644 --- a/packages/editor-mobile/src/components/editor.tsx +++ b/packages/editor-mobile/src/components/editor.tsx @@ -111,7 +111,9 @@ const Tiptap = ({ usePermissionHandler({ claims: { - premium: settings.premium + callout: !!settings.features?.callout?.isAllowed, + outlineList: !!settings.features?.outlineList?.isAllowed, + taskList: !!settings.features?.taskList?.isAllowed }, onPermissionDenied: () => { post(EditorEvents.pro, undefined, tabRef.current.id, tab.session?.noteId); diff --git a/packages/editor-mobile/src/utils/index.ts b/packages/editor-mobile/src/utils/index.ts index c7f20d599..6ffcb8e9b 100644 --- a/packages/editor-mobile/src/utils/index.ts +++ b/packages/editor-mobile/src/utils/index.ts @@ -52,6 +52,7 @@ export type Settings = { dateFormat: string; fontScale: number; markdownShortcuts: boolean; + features: Record; }; /* eslint-disable no-var */