BottomSheet: backward animation

This commit is contained in:
thislight 2024-08-12 21:55:26 +08:00
parent 6e014324de
commit 80de0e52ee
9 changed files with 150 additions and 75 deletions

View file

@ -3,18 +3,6 @@ import type { mastodon } from "masto";
import { useSessions } from "./clients";
import { updateAcctInf } from "../accounts/stores";
export function useAcctProfile(client: Accessor<mastodon.rest.Client>) {
return createResource(
client,
(client) => {
return client.v1.accounts.verifyCredentials();
},
{
name: "MastodonAccountProfile",
},
);
}
export function useSignedInProfiles() {
const sessions = useSessions();
const [accessor, tools] = createResource(sessions, async (all) => {
@ -24,11 +12,11 @@ export function useSignedInProfiles() {
});
return [
() => {
if (accessor.loading) {
accessor();
const value = accessor();
if (!value) {
return sessions().map((x) => ({ ...x, inf: x.account.inf }));
}
return accessor();
return value;
},
tools,
] as const;