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
eb72609e
Commit
eb72609e
authored
Jan 20, 2024
by
Steven
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
chore: update memo editor cache key
parent
776785ac
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
16 additions
and
7 deletions
+16
-7
EmbeddedMemo.tsx
...c/components/MemoContent/EmbeddedContent/EmbeddedMemo.tsx
+7
-1
MemoEditorDialog.tsx
web/src/components/MemoEditor/MemoEditorDialog.tsx
+7
-6
MemoView.tsx
web/src/components/MemoView.tsx
+1
-0
MemoDetail.tsx
web/src/pages/MemoDetail.tsx
+1
-0
No files found.
web/src/components/MemoContent/EmbeddedContent/EmbeddedMemo.tsx
View file @
eb72609e
import
{
useContext
,
useEffect
}
from
"react"
;
import
MemoResourceListView
from
"@/components/MemoResourceListView"
;
import
useLoading
from
"@/hooks/useLoading"
;
import
{
useMemoStore
}
from
"@/store/v1"
;
import
MemoContent
from
".."
;
...
...
@@ -33,7 +34,12 @@ const EmbeddedMemo = ({ memoId }: Props) => {
// Add the memo to the set of embedded memos. This is used to prevent infinite loops when a memo embeds itself.
context
.
embeddedMemos
.
add
(
resourceName
);
return
<
MemoContent
nodes=
{
memo
.
nodes
}
memoId=
{
memoId
}
embeddedMemos=
{
context
.
embeddedMemos
}
/>;
return
(
<
div
className=
"w-full"
>
<
MemoContent
nodes=
{
memo
.
nodes
}
memoId=
{
memoId
}
embeddedMemos=
{
context
.
embeddedMemos
}
/>
<
MemoResourceListView
resources=
{
memo
.
resources
}
/>
</
div
>
);
};
export
default
EmbeddedMemo
;
web/src/components/MemoEditor/MemoEditorDialog.tsx
View file @
eb72609e
...
...
@@ -8,10 +8,11 @@ import Icon from "../Icon";
interface
Props
extends
DialogProps
{
memoId
?:
number
;
cacheKey
?:
string
;
relationList
?:
MemoRelation
[];
}
const
MemoEditorDialog
:
React
.
FC
<
Props
>
=
({
memoId
,
relationList
,
destroy
}:
Props
)
=>
{
const
MemoEditorDialog
:
React
.
FC
<
Props
>
=
({
memoId
,
cacheKey
,
relationList
,
destroy
}:
Props
)
=>
{
const
globalStore
=
useGlobalStore
();
const
tagStore
=
useTagStore
();
const
{
systemStatus
}
=
globalStore
.
state
;
...
...
@@ -26,10 +27,10 @@ const MemoEditorDialog: React.FC<Props> = ({ memoId, relationList, destroy }: Pr
return
(
<>
<
div
className=
"
dialog-header-container
"
>
<
div
className=
"
w-full flex flex-row justify-between items-center mb-2
"
>
<
div
className=
"flex flex-row justify-start items-center"
>
<
img
className=
"w-
5
h-auto rounded-full shadow"
src=
{
systemStatus
.
customizedProfile
.
logoUrl
}
alt=
""
/>
<
p
className=
"ml-1 text-
black opacity-80 dark:text-gray-2
00"
>
{
systemStatus
.
customizedProfile
.
name
}
</
p
>
<
img
className=
"w-
6
h-auto rounded-full shadow"
src=
{
systemStatus
.
customizedProfile
.
logoUrl
}
alt=
""
/>
<
p
className=
"ml-1 text-
lg opacity-80 dark:text-gray-3
00"
>
{
systemStatus
.
customizedProfile
.
name
}
</
p
>
</
div
>
<
IconButton
size=
"sm"
onClick=
{
handleCloseBtnClick
}
>
<
Icon
.
X
className=
"w-5 h-auto"
/>
...
...
@@ -38,7 +39,7 @@ const MemoEditorDialog: React.FC<Props> = ({ memoId, relationList, destroy }: Pr
<
div
className=
"flex flex-col justify-start items-start max-w-full w-[36rem]"
>
<
MemoEditorV1
className=
"border-none !p-0 -mb-2"
cacheKey=
{
`memo-editor-${memoId}`
}
cacheKey=
{
`memo-editor-${
cacheKey ||
memoId}`
}
memoId=
{
memoId
}
relationList=
{
relationList
}
onConfirm=
{
handleCloseBtnClick
}
...
...
@@ -49,7 +50,7 @@ const MemoEditorDialog: React.FC<Props> = ({ memoId, relationList, destroy }: Pr
);
};
export
default
function
showMemoEditorDialog
(
props
:
Pick
<
Props
,
"memoId"
|
"relationList"
>
=
{}):
void
{
export
default
function
showMemoEditorDialog
(
props
:
Pick
<
Props
,
"memoId"
|
"
cacheKey"
|
"
relationList"
>
=
{}):
void
{
generateDialog
(
{
className
:
"memo-editor-dialog"
,
...
...
web/src/components/MemoView.tsx
View file @
eb72609e
...
...
@@ -106,6 +106,7 @@ const MemoView: React.FC<Props> = (props: Props) => {
const
handleEditMemoClick
=
()
=>
{
showMemoEditorDialog
({
memoId
:
memo
.
id
,
cacheKey
:
`
${
memo
.
id
}
-
${
memo
.
updateTime
}
`
,
});
};
...
...
web/src/pages/MemoDetail.tsx
View file @
eb72609e
...
...
@@ -95,6 +95,7 @@ const MemoDetail = () => {
const
handleEditMemoClick
=
()
=>
{
showMemoEditorDialog
({
memoId
:
memo
.
id
,
cacheKey
:
`
${
memo
.
id
}
-
${
memo
.
updateTime
}
`
,
});
};
...
...
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