TootBottomSheet: fix toot could not expand
This commit is contained in:
parent
d66bc8ffe1
commit
47e36a354b
1 changed files with 12 additions and 9 deletions
|
@ -29,6 +29,9 @@ import TootList from "./TootList";
|
||||||
import "./TootBottomSheet.css";
|
import "./TootBottomSheet.css";
|
||||||
import { useNavigator } from "~platform/StackedRouter";
|
import { useNavigator } from "~platform/StackedRouter";
|
||||||
import BackButton from "~platform/BackButton";
|
import BackButton from "~platform/BackButton";
|
||||||
|
import ItemSelectionProvider, {
|
||||||
|
createSingluarItemSelection,
|
||||||
|
} from "./toots/ItemSelectionProvider";
|
||||||
|
|
||||||
let cachedEntry: [string, mastodon.v1.Status] | undefined;
|
let cachedEntry: [string, mastodon.v1.Status] | undefined;
|
||||||
|
|
||||||
|
@ -44,13 +47,11 @@ function getCache(acct: string, id: string) {
|
||||||
|
|
||||||
const TootBottomSheet: Component = (props) => {
|
const TootBottomSheet: Component = (props) => {
|
||||||
const params = useParams<{ acct: string; id: string }>();
|
const params = useParams<{ acct: string; id: string }>();
|
||||||
const location = useLocation<{
|
const { push } = useNavigator();
|
||||||
tootReply?: boolean;
|
|
||||||
}>();
|
|
||||||
const { pop, push } = useNavigator();
|
|
||||||
const time = createTimeSource();
|
const time = createTimeSource();
|
||||||
const acctText = () => decodeURIComponent(params.acct);
|
const acctText = () => decodeURIComponent(params.acct);
|
||||||
const session = useSessionForAcctStr(acctText);
|
const session = useSessionForAcctStr(acctText);
|
||||||
|
const [, selectionState] = createSingluarItemSelection();
|
||||||
|
|
||||||
const [remoteToot, { mutate: setRemoteToot }] = createResource(
|
const [remoteToot, { mutate: setRemoteToot }] = createResource(
|
||||||
() => [session().client, params.id] as const,
|
() => [session().client, params.id] as const,
|
||||||
|
@ -322,11 +323,13 @@ const TootBottomSheet: Component = (props) => {
|
||||||
</div>
|
</div>
|
||||||
</Show>
|
</Show>
|
||||||
|
|
||||||
|
<ItemSelectionProvider value={selectionState}>
|
||||||
<TootList
|
<TootList
|
||||||
threads={descendants.list}
|
threads={descendants.list}
|
||||||
onUnknownThread={descendants.getPath}
|
onUnknownThread={descendants.getPath}
|
||||||
onChangeToot={descendants.set}
|
onChangeToot={descendants.set}
|
||||||
/>
|
/>
|
||||||
|
</ItemSelectionProvider>
|
||||||
</TimeSourceProvider>
|
</TimeSourceProvider>
|
||||||
</div>
|
</div>
|
||||||
</Scaffold>
|
</Scaffold>
|
||||||
|
|
Loading…
Add table
Reference in a new issue