diff --git a/internal/site/src/components/routes/settings/alerts-history-data-table.tsx b/internal/site/src/components/routes/settings/alerts-history-data-table.tsx index 24619ae5..84758ba2 100644 --- a/internal/site/src/components/routes/settings/alerts-history-data-table.tsx +++ b/internal/site/src/components/routes/settings/alerts-history-data-table.tsx @@ -41,11 +41,8 @@ import { Table, TableBody, TableCell, TableHead, TableHeader, TableRow } from "@ import { useToast } from "@/components/ui/use-toast" import { alertInfo } from "@/lib/alerts" import { pb } from "@/lib/api" -import { $userSettings } from "@/lib/stores" -import { cn, formatDuration, formatShortDate } from "@/lib/utils" +import { cn, formatDuration, formatShortDate, useBrowserStorage } from "@/lib/utils" import type { AlertsHistoryRecord } from "@/types" -import { saveSettings } from "./layout" -import { useStore } from "@nanostores/react" import { alertsHistoryColumns } from "../../alerts-history-columns" const SectionIntro = memo(() => { @@ -70,13 +67,12 @@ export default function AlertsHistoryDataTable() { const [globalFilter, setGlobalFilter] = useState("") const { toast } = useToast() const [deleteOpen, setDeleteDialogOpen] = useState(false) - const userSettings = useStore($userSettings) - // Initialize pagination with user preference - const [pagination, setPagination] = useState(() => ({ + // Store pagination preference in local storage + const [pagination, setPagination] = useBrowserStorage("ah-pagination", { pageIndex: 0, - pageSize: userSettings.alertHistoryPageSize || 10, - })) + pageSize: 10, + }) useEffect(() => { let unsubscribe: (() => void) | undefined @@ -331,13 +327,10 @@ export default function AlertsHistoryDataTable() {