Home: minor cleanup
All checks were successful
/ depoly (push) Successful in 1m20s

This commit is contained in:
thislight 2025-01-03 22:14:03 +08:00
parent 1128a01e4c
commit 70a8e15be9
No known key found for this signature in database
GPG key ID: FCFE5192241CCD4E

View file

@ -38,7 +38,7 @@ type StringRes = Record<
const Home: ParentComponent = (props) => {
let panelList: HTMLDivElement;
const [t] = createTranslator(
const [t, [stringRes]] = createTranslator(
(code) => import(`./i18n/${code}.json`) as Promise<{ default: StringRes }>,
);
const now = createTimeSource();
@ -105,17 +105,15 @@ const Home: ParentComponent = (props) => {
const windowSize = useWindowSize();
createEffect((last) => {
if (last !== windowSize.width) {
const { width } = windowSize;
if (last !== width) {
requestRecalculateTabIndicator();
}
return width;
});
const [inTransition] = useTransition();
createEffect(() => {
if (!inTransition()) {
requestAnimationFrame(recalculateTabIndicator);
}
requestRecalculateTabIndicator();
});
const isTabFocus = (idx: number) => {