mirror of
https://github.com/flarum/framework.git
synced 2025-02-27 10:48:57 +08:00
chore: replace for ... in
with Array.reduce
(#3149)
This commit is contained in:
parent
ef9db0655a
commit
d5ac76fbf4
@ -219,10 +219,10 @@ export default class IndexPage extends Page {
|
|||||||
const items = new ItemList();
|
const items = new ItemList();
|
||||||
const sortMap = app.discussions.sortMap();
|
const sortMap = app.discussions.sortMap();
|
||||||
|
|
||||||
const sortOptions = {};
|
const sortOptions = Object.keys(sortMap).reduce((acc, sortId) => {
|
||||||
for (const i in sortMap) {
|
acc[sortId] = app.translator.trans(`core.forum.index_sort.${sortId}_button`);
|
||||||
sortOptions[i] = app.translator.trans('core.forum.index_sort.' + i + '_button');
|
return acc;
|
||||||
}
|
}, {});
|
||||||
|
|
||||||
items.add(
|
items.add(
|
||||||
'sort',
|
'sort',
|
||||||
|
Loading…
x
Reference in New Issue
Block a user