diff --git a/web/src/store/v1/memoMetadata.ts b/web/src/store/v1/memoMetadata.ts index 2c92f3852d85a..fd8dd5897ca7f 100644 --- a/web/src/store/v1/memoMetadata.ts +++ b/web/src/store/v1/memoMetadata.ts @@ -41,10 +41,13 @@ export const useMemoMetadataStore = create( view: MemoView.MEMO_VIEW_METADATA_ONLY, pageSize: DEFAULT_MEMO_PAGE_SIZE, }); - const memoMap = { ...get().dataMapByName }; - for (const memo of memos) { - memoMap[memo.name] = memo; - } + const memoMap = memos.reduce>( + (acc, memo) => ({ + ...acc, + [memo.name]: memo, + }), + {}, + ); set({ stateId: uniqueId(), dataMapByName: memoMap }); return { memos, nextPageToken }; },