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
0b2f08ad
Commit
0b2f08ad
authored
Oct 06, 2024
by
Steven
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: memo view
parent
d11e7a3a
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
3 deletions
+7
-3
AddMemoRelationPopover.tsx
...onents/MemoEditor/ActionButton/AddMemoRelationPopover.tsx
+2
-1
memo.ts
web/src/store/v1/memo.ts
+5
-2
No files found.
web/src/components/MemoEditor/ActionButton/AddMemoRelationPopover.tsx
View file @
0b2f08ad
...
...
@@ -9,7 +9,7 @@ import { memoServiceClient } from "@/grpcweb";
import
{
DEFAULT_LIST_MEMOS_PAGE_SIZE
}
from
"@/helpers/consts"
;
import
useCurrentUser
from
"@/hooks/useCurrentUser"
;
import
{
MemoRelation_Type
}
from
"@/types/proto/api/v1/memo_relation_service"
;
import
{
Memo
}
from
"@/types/proto/api/v1/memo_service"
;
import
{
Memo
,
MemoView
}
from
"@/types/proto/api/v1/memo_service"
;
import
{
useTranslate
}
from
"@/utils/i18n"
;
import
{
EditorRefActions
}
from
"../Editor"
;
import
{
MemoEditorContext
}
from
"../types"
;
...
...
@@ -50,6 +50,7 @@ const AddMemoRelationPopover = (props: Props) => {
const
{
memos
}
=
await
memoServiceClient
.
listMemos
({
pageSize
:
DEFAULT_LIST_MEMOS_PAGE_SIZE
,
filter
:
filters
.
length
>
0
?
filters
.
join
(
" && "
)
:
undefined
,
view
:
MemoView
.
MEMO_VIEW_FULL
,
});
setFetchedMemos
(
memos
);
}
catch
(
error
:
any
)
{
...
...
web/src/store/v1/memo.ts
View file @
0b2f08ad
...
...
@@ -2,7 +2,7 @@ import { uniqueId } from "lodash-es";
import
{
create
}
from
"zustand"
;
import
{
combine
}
from
"zustand/middleware"
;
import
{
memoServiceClient
}
from
"@/grpcweb"
;
import
{
CreateMemoRequest
,
ListMemosRequest
,
Memo
}
from
"@/types/proto/api/v1/memo_service"
;
import
{
CreateMemoRequest
,
ListMemosRequest
,
Memo
,
MemoView
}
from
"@/types/proto/api/v1/memo_service"
;
interface
State
{
// stateId is used to identify the store instance state.
...
...
@@ -21,7 +21,10 @@ export const useMemoStore = create(
setState
:
(
state
:
State
)
=>
set
(
state
),
getState
:
()
=>
get
(),
fetchMemos
:
async
(
request
:
Partial
<
ListMemosRequest
>
)
=>
{
const
{
memos
,
nextPageToken
}
=
await
memoServiceClient
.
listMemos
(
request
);
const
{
memos
,
nextPageToken
}
=
await
memoServiceClient
.
listMemos
({
...
request
,
view
:
MemoView
.
MEMO_VIEW_FULL
,
});
const
memoMap
=
{
...
get
().
memoMapByName
};
for
(
const
memo
of
memos
)
{
memoMap
[
memo
.
name
]
=
memo
;
...
...
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