fix: user setting name (#331)

This commit is contained in:
boojack 2022-10-21 23:06:15 +08:00 committed by GitHub
parent 1c2998c4d8
commit e6f376ae66
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 4 deletions

View file

@ -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.

View file

@ -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(() => {