TootBottomSheet: added cache

This commit is contained in:
thislight 2024-08-13 14:17:33 +08:00
parent c56c098bdb
commit 368bca9fa1
No known key found for this signature in database
GPG key ID: A50F9451AC56A63E
2 changed files with 20 additions and 3 deletions

View file

@ -43,6 +43,7 @@ import PullDownToRefresh from "./PullDownToRefresh";
import { HeroSourceProvider, type HeroSource } from "../platform/anim";
import { useNavigate } from "@solidjs/router";
import { useSignedInProfiles } from "../masto/acct";
import { setCache as setTootBottomSheetCache } from "./TootBottomSheet";
const TimelinePanel: Component<{
client: mastodon.rest.Client;
@ -288,6 +289,7 @@ const Home: ParentComponent = (props) => {
const rect = srcElement?.getBoundingClientRect();
setHeroSrc((x) => Object.assign({}, x, { [BOTTOM_SHEET_HERO]: rect }));
const acct = `${inf.username}@${p.account.site}`;
setTootBottomSheetCache(acct, toot);
navigate(`/${encodeURIComponent(acct)}/${toot.id}`);
};