2023-08-10 15:56:36 -07:00
|
|
|
import { useLocalStorage } from "../util";
|
|
|
|
|
|
|
|
/**
|
|
|
|
* usePreferArchive helps the user choose to try using our archive before
|
|
|
|
* using images.neopets.com, when images.neopets.com is being slow and bleh!
|
|
|
|
*/
|
|
|
|
function usePreferArchive() {
|
2024-09-09 16:10:45 -07:00
|
|
|
const [preferArchiveSavedValue, setPreferArchive] = useLocalStorage(
|
|
|
|
"DTIPreferArchive",
|
|
|
|
null,
|
|
|
|
);
|
2023-08-10 15:56:36 -07:00
|
|
|
|
2024-09-09 16:10:45 -07:00
|
|
|
// Oct 13 2022: I might default this back to on again if the lag gets
|
|
|
|
// miserable again, but it's okaaay right now? ish? Bad enough that I want to
|
|
|
|
// offer this option, but decent enough that I don't want to turn it on by
|
|
|
|
// default and break new items yet!
|
|
|
|
const preferArchive = preferArchiveSavedValue ?? false;
|
2023-08-10 15:56:36 -07:00
|
|
|
|
2024-09-09 16:10:45 -07:00
|
|
|
return [preferArchive, setPreferArchive];
|
2023-08-10 15:56:36 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
export default usePreferArchive;
|