mirror of
https://github.com/usememos/memos.git
synced 2025-02-21 05:40:57 +01:00
chore: fix frontend linter
This commit is contained in:
parent
898b3c3779
commit
7e23ceb242
@ -3,7 +3,7 @@ import classNames from "classnames";
|
||||
import { repeat } from "lodash-es";
|
||||
import { useContext, useState } from "react";
|
||||
import { useMemoStore } from "@/store/v1";
|
||||
import { Node, NodeType } from "@/types/node";
|
||||
import { Node, NodeType, TaskListNode } from "@/types/node";
|
||||
import Renderer from "./Renderer";
|
||||
import { RendererContext } from "./types";
|
||||
|
||||
@ -31,11 +31,11 @@ const TaskList: React.FC<Props> = ({ index, indent, complete, children }: Props)
|
||||
}
|
||||
|
||||
const node = context.nodes[nodeIndex];
|
||||
if (node.type !== NodeType.TASK_LIST || !node.taskListNode) {
|
||||
if (node.type !== NodeType.TASK_LIST || !node.node) {
|
||||
return;
|
||||
}
|
||||
|
||||
node.taskListNode!.complete = on;
|
||||
(node.node as TaskListNode)!.complete = on;
|
||||
const content = window.restore(context.nodes);
|
||||
await memoStore.updateMemo(
|
||||
{
|
||||
|
@ -14,8 +14,8 @@ export const extractTagsFromContent = (content: string) => {
|
||||
}
|
||||
|
||||
handle(node);
|
||||
if (node.paragraphNode || node.unorderedListNode || node.orderedListNode) {
|
||||
const children = ((node.paragraphNode || node.unorderedListNode || node.orderedListNode) as any).children;
|
||||
if (node.type === "PARAGRAPH" || node.type === "ORDERED_LIST" || node.type === "UNORDERED_LIST") {
|
||||
const children = (node.node as any).children;
|
||||
if (Array.isArray(children)) {
|
||||
traverse(children, handle);
|
||||
}
|
||||
@ -24,8 +24,8 @@ export const extractTagsFromContent = (content: string) => {
|
||||
};
|
||||
|
||||
traverse(nodes, (node) => {
|
||||
if (node.tagNode?.content) {
|
||||
tags.add(node.tagNode.content);
|
||||
if (node.type === "TAG" && node.node) {
|
||||
tags.add((node.node as any).content);
|
||||
}
|
||||
});
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user