useSignedInProfiles: removed
- use useSessions() instead
This commit is contained in:
parent
832a59031a
commit
dde0c249f4
3 changed files with 8 additions and 37 deletions
|
@ -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;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue