Settings: prefetching toots
This commit is contained in:
parent
c25ca17043
commit
c204bdd70b
3 changed files with 19 additions and 4 deletions
|
@ -35,6 +35,8 @@ import { Create as CreateTootIcon } from "@suid/icons-material";
|
|||
import { useTimeline } from "../masto/timelines";
|
||||
import { makeEventListener } from "@solid-primitives/event-listener";
|
||||
import BottomSheet from "../material/BottomSheet";
|
||||
import { $settings } from "../settings/stores";
|
||||
import { useStore } from "@nanostores/solid";
|
||||
|
||||
const TimelinePanel: Component<{
|
||||
client: mastodon.rest.Client;
|
||||
|
@ -153,12 +155,13 @@ const Home: ParentComponent = (props) => {
|
|||
useDocumentTitle("Timelines");
|
||||
const now = createTimeSource();
|
||||
|
||||
const settings$ = useStore($settings)
|
||||
const sessions = useSessions();
|
||||
const client = () => sessions()[0].client;
|
||||
const [profile] = useAcctProfile(client);
|
||||
|
||||
const [panelOffset, setPanelOffset] = createSignal(0);
|
||||
const [prefetching, setPrefetching] = createSignal(true);
|
||||
const prefetching = () => !settings$().prefetchTootsDisabled
|
||||
const [currentFocusOn, setCurrentFocusOn] = createSignal<HTMLElement[]>([]);
|
||||
const [focusRange, setFocusRange] = createSignal([0, 0] as readonly [
|
||||
number,
|
||||
|
@ -279,7 +282,7 @@ const Home: ParentComponent = (props) => {
|
|||
</Tab>
|
||||
</Tabs>
|
||||
<ProfileMenuButton profile={profile()}>
|
||||
<MenuItem onClick={(e) => setPrefetching((x) => !x)}>
|
||||
<MenuItem onClick={(e) => $settings.setKey("prefetchTootsDisabled", !$settings.get().prefetchTootsDisabled)}>
|
||||
<ListItemText>Prefetch Toots</ListItemText>
|
||||
<ListItemSecondaryAction>
|
||||
<Switch checked={prefetching()}></Switch>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue