From e6f376ae660eeb913b75f7bc0a911fed1d098f75 Mon Sep 17 00:00:00 2001 From: boojack Date: Fri, 21 Oct 2022 23:06:15 +0800 Subject: [PATCH] fix: user setting name (#331) --- api/user_setting.go | 2 +- web/src/components/MemoList.tsx | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/api/user_setting.go b/api/user_setting.go index 77c728fc..ef0c405e 100644 --- a/api/user_setting.go +++ b/api/user_setting.go @@ -17,7 +17,7 @@ const ( // UserSettingEditorFontStyleKey is the key type for mobile editor style. UserSettingMobileEditorStyleKey UserSettingKey = "mobileEditorStyle" // UserSettingMemoDisplayTsOptionKey is the key type for memo display ts option. - UserSettingMemoDisplayTsOptionKey UserSettingKey = "memoSortOption" + UserSettingMemoDisplayTsOptionKey UserSettingKey = "memoDisplayTsOption" ) // String returns the string format of UserSettingKey type. diff --git a/web/src/components/MemoList.tsx b/web/src/components/MemoList.tsx index 019cf5e6..e29b2f92 100644 --- a/web/src/components/MemoList.tsx +++ b/web/src/components/MemoList.tsx @@ -73,11 +73,11 @@ const MemoList = () => { const pinnedMemos = shownMemos.filter((m) => m.pinned); const unpinnedMemos = shownMemos.filter((m) => !m.pinned); - const memoSorting = (mi: Memo, mj: Memo) => { + const memoSort = (mi: Memo, mj: Memo) => { return mj.displayTs - mi.displayTs; }; - pinnedMemos.sort(memoSorting); - unpinnedMemos.sort(memoSorting); + pinnedMemos.sort(memoSort); + unpinnedMemos.sort(memoSort); const sortedMemos = pinnedMemos.concat(unpinnedMemos).filter((m) => m.rowStatus === "NORMAL"); useEffect(() => {