Skip to content

Commit ded11ca

Browse files
committed
✨ 最后更新添加排序功能 #250
1 parent 0b4d241 commit ded11ca

4 files changed

Lines changed: 6 additions & 4 deletions

File tree

‎src/locales/zh-CN/translation.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@
106106
},
107107
"enable": "开启",
108108
"script_list_enable_width": 100,
109-
"script_list_last_updated_width": 100,
109+
"script_list_last_updated_width": 120,
110110
"script_list_apply_to_run_status_width": 140,
111111
"subscribe_list_enable_width": 100,
112112
"disable": "关闭",

‎src/locales/zh-TW/translation.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@
106106
},
107107
"enable": "開啟",
108108
"script_list_enable_width": 100,
109-
"script_list_last_updated_width": 100,
109+
"script_list_last_updated_width": 120,
110110
"script_list_apply_to_run_status_width": 140,
111111
"subscribe_list_enable_width": 100,
112112
"disable": "關閉",

‎src/pages/options/routes/ScriptList.tsx‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -407,6 +407,7 @@ function ScriptList() {
407407
align: "center",
408408
key: "updatetime",
409409
width: t("script_list_last_updated_width"),
410+
sorter: (a, b) => a.updatetime - b.updatetime,
410411
render(col, script: Script) {
411412
return (
412413
// eslint-disable-next-line jsx-a11y/click-events-have-key-events, jsx-a11y/no-static-element-interactions

‎src/pages/options/routes/SubscribeList.tsx‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ function SubscribeList() {
3535
) as SubscribeController;
3636
const [list, setList] = useState<ListType[]>([]);
3737
const inputRef = useRef<RefInputType>(null);
38-
const { t, i18n } = useTranslation(); // 使用 useTranslation hook
38+
const { t } = useTranslation(); // 使用 useTranslation hook
3939

4040
useEffect(() => {
4141
dao.table
@@ -215,7 +215,8 @@ function SubscribeList() {
215215
dataIndex: "updatetime",
216216
align: "center",
217217
key: "updatetime",
218-
width: i18n.language === "zh-CN" ? 100 : "auto",
218+
width: t("script_list_last_updated_width"),
219+
sorter: (a, b) => a.updatetime - b.updatetime,
219220
render(col, subscribe: Subscribe) {
220221
return (
221222
// eslint-disable-next-line jsx-a11y/click-events-have-key-events, jsx-a11y/no-static-element-interactions

0 commit comments

Comments
 (0)