fix the mess I started
This commit is contained in:
15
src/utils/hooks/useActiveAccount.tsx
Normal file
15
src/utils/hooks/useActiveAccount.tsx
Normal file
@@ -0,0 +1,15 @@
|
||||
import { getActiveAccount } from '@lume/utils/storage';
|
||||
|
||||
import useSWR from 'swr';
|
||||
|
||||
const fetcher = () => getActiveAccount();
|
||||
|
||||
export const useActiveAccount = () => {
|
||||
const { data, error, isLoading } = useSWR('activeAcount', fetcher);
|
||||
|
||||
return {
|
||||
account: data,
|
||||
isLoading,
|
||||
isError: error,
|
||||
};
|
||||
};
|
||||
@@ -1,7 +1,7 @@
|
||||
import destr from 'destr';
|
||||
|
||||
// convert NIP-02 to array of pubkey
|
||||
export const nip02ToArray = (tags: string[]) => {
|
||||
export const nip02ToArray = (tags: any) => {
|
||||
const arr = [];
|
||||
tags.forEach((item) => {
|
||||
arr.push(item[1]);
|
||||
|
||||
Reference in New Issue
Block a user