Skip to content

Commit

Permalink
Don't throw on a missing chainId
Browse files Browse the repository at this point in the history
  • Loading branch information
jessepinho committed Mar 14, 2024
1 parent 3d592f1 commit 599316e
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions apps/minifront/src/fetchers/chain-id.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
import { viewClient } from '../clients';

export const getChainId = async (): Promise<string> => {
export const getChainId = async (): Promise<string | undefined> => {
const { parameters } = await viewClient.appParameters({});
if (!parameters?.chainId) throw new Error('No chainId in response');

return parameters.chainId;
return parameters?.chainId;
};

0 comments on commit 599316e

Please sign in to comment.