diff --git a/api/resolvers/wallet.js b/api/resolvers/wallet.js index 40e97ac9..95467dc6 100644 --- a/api/resolvers/wallet.js +++ b/api/resolvers/wallet.js @@ -56,7 +56,7 @@ export default { throw new AuthenticationError('you must be logged in') } - const include = new Set(inc.split(',')) + const include = new Set(inc?.split(',')) const queries = [] if (include.has('invoice')) { diff --git a/pages/satistics.js b/pages/satistics.js index 4b45c68a..dbbefafd 100644 --- a/pages/satistics.js +++ b/pages/satistics.js @@ -112,7 +112,7 @@ export default function Satistics ({ data: { walletHistory: { facts, cursor } } const { data, fetchMore } = useQuery(WALLET_HISTORY, { variables: { inc: router.query.inc } }) function filterRoutePush (filter, add) { - const inc = new Set(router.query.inc.split(',')) + const inc = new Set(router.query.inc?.split(',')) inc.delete('') // depending on addrem, add or remove filter if (add) { @@ -126,7 +126,7 @@ export default function Satistics ({ data: { walletHistory: { facts, cursor } } } function included (filter) { - const inc = new Set(router.query.inc.split(',')) + const inc = new Set(router.query.inc?.split(',')) return inc.has(filter) } diff --git a/pages/wallet.js b/pages/wallet.js index 4c9a0fd1..3eb8d8a4 100644 --- a/pages/wallet.js +++ b/pages/wallet.js @@ -31,8 +31,19 @@ function YouHaveSats () { ) } +function WalletHistory () { + return ( +
+ + wallet history + +
+ ) +} + export function WalletForm () { const router = useRouter() + if (!router.query.type) { return (
@@ -44,6 +55,7 @@ export function WalletForm () { +
) } @@ -112,6 +124,7 @@ export function FundForm () { /> generate invoice + ) } @@ -180,6 +193,7 @@ export function WithdrawlForm () { + ) }