mirror of
				https://github.com/usememos/memos.git
				synced 2025-10-31 00:38:08 +08:00 
			
		
		
		
	fix: memo view
This commit is contained in:
		
							parent
							
								
									d11e7a3a9a
								
							
						
					
					
						commit
						0b2f08ad15
					
				
					 2 changed files with 7 additions and 3 deletions
				
			
		|  | @ -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) { | ||||
|  |  | |||
|  | @ -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; | ||||
|  |  | |||
		Loading…
	
	Add table
		
		Reference in a new issue