mirror of
https://github.com/streetwriters/notesnook.git
synced 2026-09-02 04:01:43 +02:00
mobile: fix editor settings not applying properly on random basis
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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;
|
||||
};
|
||||
|
||||
@@ -424,7 +424,13 @@ const useTiptap = (
|
||||
timeFormat,
|
||||
editorProps,
|
||||
copyToClipboard,
|
||||
createInternalLink
|
||||
createInternalLink,
|
||||
dayFormat,
|
||||
doubleSpacedLines,
|
||||
enableFontLigatures,
|
||||
getLinkData,
|
||||
downloadCsvTable,
|
||||
options.placeholder
|
||||
]
|
||||
);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user