mobile: fix editor settings not applying properly on random basis

This commit is contained in:
Ammar Ahmed
2026-08-20 10:30:16 +05:00
parent 5d03d3033f
commit 1f150e0fa0
3 changed files with 17 additions and 3 deletions

View File

@@ -209,7 +209,6 @@ export const useEditorEvents = (
};
}, [editor, editor.commands, editor.postMessage]);
useEffect(() => {
if (loading) return;
if (typeof defaultFontFamily === "object") {
SettingsService.set({
defaultFontFamily: (defaultFontFamily as any).id

View File

@@ -18,7 +18,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
import { getDefaultPresets } from "@notesnook/editor";
import { useState } from "react";
import { useEffect, useState } from "react";
import { Settings } from "../utils";
const settingsJson = localStorage.getItem("editorSettings");
@@ -74,5 +74,14 @@ export const useSettings = (): Settings => {
});
global.settingsController.set = setSettings;
useEffect(() => {
setSettings((current) =>
JSON.stringify(current) ===
JSON.stringify(global.settingsController.previous)
? current
: { ...global.settingsController.previous }
);
}, []);
return settings;
};

View File

@@ -424,7 +424,13 @@ const useTiptap = (
timeFormat,
editorProps,
copyToClipboard,
createInternalLink
createInternalLink,
dayFormat,
doubleSpacedLines,
enableFontLigatures,
getLinkData,
downloadCsvTable,
options.placeholder
]
);