feat: add recent tools tracking via localStorage

This commit is contained in:
SnapOtter
2026-06-14 18:36:28 +08:00
parent f9ebb304db
commit 6c61ae47f4
2 changed files with 41 additions and 0 deletions
+8
View File
@@ -26,6 +26,7 @@ import type { PreviewTransform } from "@/components/tools/rotate-settings";
import { useTranslation } from "@/contexts/i18n-context";
import { useAuth } from "@/hooks/use-auth";
import { useMobile } from "@/hooks/use-mobile";
import { recordRecentTool } from "@/hooks/use-recent-tools";
import { usePageTitle } from "@/hooks/use-page-title";
import { formatFileSize } from "@/lib/download";
import { format } from "@/lib/format";
@@ -197,6 +198,13 @@ export function ToolPage() {
useEffect(() => {
if (isAiTool) fetchFeatures();
}, [isAiTool, fetchFeatures]);
useEffect(() => {
if (tool) {
recordRecentTool(tool.id);
}
}, [tool]);
const {
files,
entries,