Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
canifa_note
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Vũ Hoàng Anh
canifa_note
Commits
1424036c
Commit
1424036c
authored
Nov 17, 2024
by
johnnyjoy
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
chore: use for...of
parent
f6af564d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
14 deletions
+9
-14
MemoActionMenu.tsx
web/src/components/MemoActionMenu.tsx
+9
-14
No files found.
web/src/components/MemoActionMenu.tsx
View file @
1424036c
...
@@ -120,22 +120,17 @@ const MemoActionMenu = (props: Props) => {
...
@@ -120,22 +120,17 @@ const MemoActionMenu = (props: Props) => {
const
confirmed
=
window
.
confirm
(
t
(
"memo.remove-completed-task-list-items-confirm"
));
const
confirmed
=
window
.
confirm
(
t
(
"memo.remove-completed-task-list-items-confirm"
));
if
(
confirmed
)
{
if
(
confirmed
)
{
const
newNodes
=
JSON
.
parse
(
JSON
.
stringify
(
memo
.
nodes
));
const
newNodes
=
JSON
.
parse
(
JSON
.
stringify
(
memo
.
nodes
));
for
(
let
i
=
0
;
i
<
newNodes
.
length
;
i
++
)
{
for
(
const
node
of
newNodes
)
{
if
(
newNodes
[
i
].
type
===
NodeType
.
LIST
&&
newNodes
[
i
].
listNode
?.
children
?.
length
>
0
)
{
if
(
node
.
type
===
NodeType
.
LIST
&&
node
.
listNode
?.
children
?.
length
>
0
)
{
let
childrenLength
=
newNodes
[
i
].
listNode
.
children
.
length
;
const
children
=
node
.
listNode
.
children
;
for
(
let
j
=
0
;
j
<
childrenLength
;
j
++
)
{
for
(
let
i
=
0
;
i
<
children
.
length
;
i
++
)
{
if
(
if
(
children
[
i
].
type
===
NodeType
.
TASK_LIST_ITEM
&&
children
[
i
].
taskListItemNode
?.
complete
)
{
newNodes
[
i
].
listNode
.
children
[
j
].
type
===
NodeType
.
TASK_LIST_ITEM
&&
newNodes
[
i
].
listNode
.
children
[
j
].
taskListItemNode
?.
complete
)
{
// Remove completed taskList item and next line breaks
// Remove completed taskList item and next line breaks
newNodes
[
i
].
listNode
.
children
.
splice
(
j
,
1
);
children
.
splice
(
i
,
1
);
if
(
newNodes
[
i
].
listNode
.
children
[
j
]?.
type
===
NodeType
.
LINE_BREAK
)
{
if
(
children
[
i
]?.
type
===
NodeType
.
LINE_BREAK
)
{
newNodes
[
i
].
listNode
.
children
.
splice
(
j
,
1
);
children
.
splice
(
i
,
1
);
childrenLength
--
;
}
}
childrenLength
--
;
i
--
;
j
--
;
}
}
}
}
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment