fix: copy by reference (#3517)

* Fixed issue with copy by reference

* Fixed linting issues

---------

Co-authored-by: Martin MacDonald <martinmacdonald@Martins-MacBook-Pro.local>
This commit is contained in:
Martin MacDonald 2024-06-05 01:04:50 +01:00 committed by GitHub
parent 0977acbc7f
commit 2ebd5c64bd
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -17,7 +17,7 @@ export const useMemoStore = create(
getState: () => get(),
fetchMemos: async (request: Partial<ListMemosRequest>) => {
const { memos, nextPageToken } = await memoServiceClient.listMemos(request);
const memoMap = get().memoMapByName;
const memoMap = { ...get().memoMapByName };
for (const memo of memos) {
memoMap[memo.name] = memo;
}