mirror of
https://github.com/streetwriters/notesnook.git
synced 2026-02-23 19:49:56 +01:00
mobile: fix build
This commit is contained in:
committed by
Abdullah Atta
parent
9bc8bddc12
commit
e513081010
@@ -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<EditorProps>
|
||||
) => {
|
||||
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 () => {
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -52,6 +52,7 @@ export type Settings = {
|
||||
dateFormat: string;
|
||||
fontScale: number;
|
||||
markdownShortcuts: boolean;
|
||||
features: Record<any, any>;
|
||||
};
|
||||
|
||||
/* eslint-disable no-var */
|
||||
|
||||
Reference in New Issue
Block a user