rewrite client providing & fix sign in redirect
This commit is contained in:
parent
942b9dcce8
commit
0caa9aab88
5 changed files with 106 additions and 53 deletions
|
@ -1,9 +1,6 @@
|
|||
import { persistentAtom } from "@nanostores/persistent";
|
||||
import { useStore } from "@nanostores/solid";
|
||||
import { useNavigate } from "@solidjs/router";
|
||||
import { createOAuthAPIClient, createRestAPIClient } from "masto";
|
||||
import { action } from "nanostores";
|
||||
import { createRenderEffect } from "solid-js";
|
||||
|
||||
export type Account = {
|
||||
site: string;
|
||||
|
@ -175,15 +172,3 @@ export const getOrRegisterApp = action(
|
|||
return all[site];
|
||||
},
|
||||
);
|
||||
|
||||
export function useAccts() {
|
||||
const accts = useStore($accounts);
|
||||
const naviagte = useNavigate();
|
||||
|
||||
createRenderEffect(() => {
|
||||
if (accts().length > 0) return;
|
||||
naviagte("/accounts/sign-in");
|
||||
});
|
||||
|
||||
return accts;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue