This commit is contained in:
Ren Amamiya
2023-03-24 10:59:28 +07:00
parent 18a9bf3e49
commit 47f6e6833b
32 changed files with 419 additions and 524 deletions

9
src/stores/account.tsx Normal file
View File

@@ -0,0 +1,9 @@
import { isSSR } from '@utils/ssr';
import { getActiveAccount } from '@utils/storage';
import { atomWithCache } from 'jotai-cache';
export const activeAccountAtom = atomWithCache(async () => {
const response = isSSR ? null : await getActiveAccount();
return response;
});

9
src/stores/relays.tsx Normal file
View File

@@ -0,0 +1,9 @@
import { isSSR } from '@utils/ssr';
import { getAllRelays } from '@utils/storage';
import { atomWithCache } from 'jotai-cache';
export const relaysAtom = atomWithCache(async () => {
const response = isSSR ? null : await getAllRelays();
return response;
});

View File

@@ -1,3 +0,0 @@
import { atom } from 'jotai';
export const currentUser = atom({});