Skip to content

Commit

Permalink
added default chain id for connector
Browse files Browse the repository at this point in the history
  • Loading branch information
mrtmeeseeks committed May 20, 2024
1 parent e3de1a8 commit eca108b
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 17 deletions.
4 changes: 3 additions & 1 deletion src/api/ProviderFactory/web3-daut-connect.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,9 @@ function Web3DautConnect({
chainId,
status,
address
} = useAutConnector();
} = useAutConnector({
defaultChainId: +environment.defaultChainId
});

const onAutInit = async () => {
const [, username] = location.pathname.split("/");
Expand Down
4 changes: 3 additions & 1 deletion src/api/aut.api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@ export const getAppConfig = (): Promise<NetworkConfig[]> => {
};

export const useAuthenticatedApi = () => {
const { multiSigner, address } = useAutConnector();
const { multiSigner, address } = useAutConnector({
defaultChainId: +environment.defaultChainId
});
const [jwt, setjwt] = useState<string | null>(
localStorage.getItem("interactions-api-jwt")
);
Expand Down
1 change: 1 addition & 0 deletions src/api/environment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ export const swEnvVariables = {

// Aut networks
networkEnv: "REACT_APP_NETWORK_ENV",
defaultChainId: "REACT_APP_DEFAULT_CHAIN_ID",

// IPFS storage
ipfsApiKey: "REACT_APP_IPFS_API_KEY",
Expand Down
18 changes: 3 additions & 15 deletions src/components/AutInteractionsDialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -91,18 +91,9 @@ export function useBackendJwt() {
// }
// }, []);

const {
isConnected,
isConnecting,
connect,
disconnect,
setStateChangeCallback,
multiSigner,
multiSignerId,
chainId,
status,
address
} = useAutConnector();
const { multiSigner, address } = useAutConnector({
defaultChainId: +environment.defaultChainId
});

async function doAuthenticatedAction(action) {
const jwt = window.localStorage.getItem("interactions-api-jwt");
Expand Down Expand Up @@ -134,9 +125,6 @@ export function useBackendJwt() {
}

export function AutInteractionsDialog(props: InteractionsDialogProps) {
const dispatch = useAppDispatch();
const [editInitiated, setEditInitiated] = useState(false);

const theme = useTheme();
const desktop = useMediaQuery(theme.breakpoints.up("md"));
return (
Expand Down

0 comments on commit eca108b

Please sign in to comment.