You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
bazarr/frontend/src/utilities/storage.ts

20 lines
489 B

import { useSystemSettings } from "@/apis/hooks";
import { useCallback } from "react";
export const uiPageSizeKey = "settings-general-page_size";
export function useUpdateLocalStorage() {
return useCallback((newVals: LooseObject) => {
for (const key in newVals) {
const value = newVals[key];
localStorage.setItem(key, value);
}
}, []);
}
export function usePageSize() {
const settings = useSystemSettings();
return settings.data?.general.page_size ?? 50;
}