Skip to content

Commit aaeeab7

Browse files
author
onesine
committed
Fix shortcuts bug
1 parent 7110fdc commit aaeeab7

File tree

1 file changed

+15
-17
lines changed

1 file changed

+15
-17
lines changed

src/components/Shortcuts.tsx

Lines changed: 15 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -57,29 +57,27 @@ const Shortcuts = () => {
5757
return (
5858
<div className="md:border-b mb-3 lg:mb-0 lg:border-r lg:border-b-0 border-gray-300 dark:border-gray-700 pr-1">
5959
<ul className="w-full tracking-wide flex flex-wrap lg:flex-col pb-1 lg:pb-0">
60-
{configs?.shortcuts ? (
61-
Object.entries(DEFAULT_SHORTCUTS)).map(([key, item], index) => (
62-
key === "past" ? (
63-
(Array.isArray(item) ? item : []).map((item, index) => (
64-
<ItemTemplate key={index} item={item}>
65-
<>
66-
{configs && configs.shortcuts && (key in configs.shortcuts) ? (
67-
callPassFunction(configs.shortcuts[key], item.daysNumber)
68-
) : item.text}
69-
</>
70-
</ItemTemplate>
71-
))
72-
) : (
60+
{(Object.entries(DEFAULT_SHORTCUTS)).map(([key, item], index) => (
61+
key === "past" ? (
62+
(Array.isArray(item) ? item : []).map((item, index) => (
7363
<ItemTemplate key={index} item={item}>
7464
<>
7565
{configs && configs.shortcuts && (key in configs.shortcuts) ? (
76-
configs.shortcuts[key as keyof typeof configs.shortcuts]
77-
) : ("text" in item ? item.text : "")}
66+
callPassFunction(configs.shortcuts[key], item.daysNumber)
67+
) : item.text}
7868
</>
7969
</ItemTemplate>
80-
)
70+
))
71+
) : (
72+
<ItemTemplate key={index} item={item}>
73+
<>
74+
{configs && configs.shortcuts && (key in configs.shortcuts) ? (
75+
configs.shortcuts[key as keyof typeof configs.shortcuts]
76+
) : ("text" in item ? item.text : "")}
77+
</>
78+
</ItemTemplate>
8179
)
82-
) : null}
80+
))}
8381
</ul>
8482
</div>
8583
);

0 commit comments

Comments
 (0)