useSignedInProfiles: removed

- use useSessions() instead
This commit is contained in:
thislight 2024-11-04 17:09:20 +08:00
parent 832a59031a
commit dde0c249f4
No known key found for this signature in database
GPG key ID: FCFE5192241CCD4E
3 changed files with 8 additions and 37 deletions

View file

@ -1,28 +0,0 @@
import { Accessor, createResource } from "solid-js";
import type { mastodon } from "masto";
import { useSessions } from "./clients";
import { updateAcctInf } from "../accounts/stores";
export function useSignedInProfiles() {
const sessions = useSessions();
const [accessor, tools] = createResource(sessions, async (all) => {
return Promise.all(
all.map(async (x, i) => ({ ...x, inf: await updateAcctInf(i) })),
);
});
return [
() => {
try {
const value = accessor();
if (value) {
return value;
}
} catch (reason) {
console.error("useSignedInProfiles: update acct info failed", reason);
}
return sessions().map((x) => ({ ...x, inf: x.account.inf }));
},
tools,
] as const;
}