fix: privacy setting is not working

This commit is contained in:
2024-04-17 13:50:50 +07:00
parent 413d8d82df
commit f3c52237fa
2 changed files with 33 additions and 58 deletions

View File

@@ -25,7 +25,9 @@ export function NoteContent({
compact?: boolean;
className?: string;
}) {
const settings: Settings = useRouteContext({ strict: false });
const { settings }: { settings: Settings } = useRouteContext({
strict: false,
});
const event = useNoteContext();
const content = useMemo(() => {
const text = event.content.trim();
@@ -124,7 +126,7 @@ export function NoteContent({
);
if (compact) {
parsedContent = reactStringReplace(parsedContent, /\n|\r/g, () => (
parsedContent = reactStringReplace(parsedContent, /[\r\n]{2,}/g, () => (
<div key={nanoid()} className="h-1.5" />
));
}