mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-05-05 04:57:42 +03:00
fix: fix mobile bottom bar reindexing embeddings i18n wrong
This commit is contained in:
parent
d71637327b
commit
371e9b41f8
@ -16,6 +16,7 @@ import { Link } from "react-router-dom";
|
|||||||
import { cn } from "@/lib/utils";
|
import { cn } from "@/lib/utils";
|
||||||
import { isIOS, isMobile } from "react-device-detect";
|
import { isIOS, isMobile } from "react-device-detect";
|
||||||
import { isPWA } from "@/utils/isPWA";
|
import { isPWA } from "@/utils/isPWA";
|
||||||
|
import { useTranslation } from "react-i18next";
|
||||||
|
|
||||||
function Bottombar() {
|
function Bottombar() {
|
||||||
const navItems = useNavigation("secondary");
|
const navItems = useNavigation("secondary");
|
||||||
@ -43,6 +44,7 @@ type StatusAlertNavProps = {
|
|||||||
className?: string;
|
className?: string;
|
||||||
};
|
};
|
||||||
function StatusAlertNav({ className }: StatusAlertNavProps) {
|
function StatusAlertNav({ className }: StatusAlertNavProps) {
|
||||||
|
const { t } = useTranslation(["views/system"]);
|
||||||
const { data: initialStats } = useSWR<FrigateStats>("stats", {
|
const { data: initialStats } = useSWR<FrigateStats>("stats", {
|
||||||
revalidateOnFocus: false,
|
revalidateOnFocus: false,
|
||||||
});
|
});
|
||||||
@ -82,14 +84,19 @@ function StatusAlertNav({ className }: StatusAlertNavProps) {
|
|||||||
clearMessages("embeddings-reindex");
|
clearMessages("embeddings-reindex");
|
||||||
addMessage(
|
addMessage(
|
||||||
"embeddings-reindex",
|
"embeddings-reindex",
|
||||||
`Reindexing embeddings (${Math.floor((reindexState.processed_objects / reindexState.total_objects) * 100)}% complete)`,
|
t("stats.reindexingEmbeddings", {
|
||||||
|
processed: Math.floor(
|
||||||
|
(reindexState.processed_objects / reindexState.total_objects) *
|
||||||
|
100,
|
||||||
|
),
|
||||||
|
}),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
if (reindexState.status === "completed") {
|
if (reindexState.status === "completed") {
|
||||||
clearMessages("embeddings-reindex");
|
clearMessages("embeddings-reindex");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}, [reindexState, addMessage, clearMessages]);
|
}, [reindexState, addMessage, clearMessages, t]);
|
||||||
|
|
||||||
if (!messages || Object.keys(messages).length === 0) {
|
if (!messages || Object.keys(messages).length === 0) {
|
||||||
return;
|
return;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user