add useSessionForAcctStr
This commit is contained in:
parent
040016ddce
commit
657c886fab
2 changed files with 39 additions and 16 deletions
|
@ -15,7 +15,7 @@ import {
|
|||
ArrowBack as BackIcon,
|
||||
Close as CloseIcon,
|
||||
} from "@suid/icons-material";
|
||||
import { createUnauthorizedClient, useSessions } from "../masto/clients";
|
||||
import { useSessionForAcctStr } from "../masto/clients";
|
||||
import { resolveCustomEmoji } from "../masto/toot";
|
||||
import RegularToot from "./RegularToot";
|
||||
import type { mastodon } from "masto";
|
||||
|
@ -45,24 +45,10 @@ const TootBottomSheet: Component = (props) => {
|
|||
tootReply?: boolean;
|
||||
}>();
|
||||
const navigate = useNavigate();
|
||||
const allSession = useSessions();
|
||||
const time = createTimeSource();
|
||||
const [isInTyping, setInTyping] = createSignal(false);
|
||||
const acctText = () => decodeURIComponent(params.acct);
|
||||
const session = () => {
|
||||
const [inputUsername, inputSite] = acctText().split("@", 2);
|
||||
const authedSession = allSession().find(
|
||||
(x) =>
|
||||
x.account.site === inputSite &&
|
||||
x.account.inf?.username === inputUsername,
|
||||
);
|
||||
return (
|
||||
authedSession ?? {
|
||||
client: createUnauthorizedClient(inputSite),
|
||||
account: undefined,
|
||||
}
|
||||
);
|
||||
};
|
||||
const session = useSessionForAcctStr(acctText)
|
||||
|
||||
const pushedCount = () => {
|
||||
return location.state?.tootBottomSheetPushedCount || 0;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue