Skip to content

Commit cf58447

Browse files
committed
[CODEBEAT]: Block nesting too deep
1 parent 528e140 commit cf58447

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/app/components/whitelist/alert-info.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,13 @@ import { ElAlert } from "element-plus"
1616
import { t } from "../../locale"
1717
import { WhitelistMessage } from "../../locale/components/whitelist"
1818

19-
const liKeys: (keyof WhitelistMessage)[] = ['infoAlert0', 'infoAlert1']
19+
const title = t(msg => msg.whitelist.infoAlertTitle)
2020

21+
const liKeys: (keyof WhitelistMessage)[] = ['infoAlert0', 'infoAlert1']
22+
const generateList = () => liKeys.map(key => h('li', t(msg => msg.whitelist[key])))
2123
const alertInfo = () => h(ElAlert,
22-
{ type: 'info', title: t(msg => msg.whitelist.infoAlertTitle) },
23-
() => liKeys.map(key => h('li', t(msg => msg.whitelist[key])))
24+
{ type: 'info', title },
25+
generateList
2426
)
2527

2628
export default alertInfo

0 commit comments

Comments
 (0)