Skip to content

Commit

Permalink
fix: dest chain rerender bug
Browse files Browse the repository at this point in the history
  • Loading branch information
salil-naik committed Mar 23, 2023
1 parent 93385dd commit e0bb0d5
Show file tree
Hide file tree
Showing 3 changed files with 9,677 additions and 9,413 deletions.
4 changes: 1 addition & 3 deletions src/components/Output.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -141,9 +141,7 @@ export const Output = ({
) ?? networksSubset?.[0]
);
setFirstRenderNetwork(false);
} else if (sourceChainId === destChainId) {
updateNetwork(networksSubset?.[0]);
}
} else updateNetwork(networksSubset?.[0]);
}
}, [supportedNetworks, sourceChainId, defaultDestNetwork]);

Expand Down
3 changes: 3 additions & 0 deletions src/stories/Test.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,9 @@ const Template = (args: WidgetProps) => {
}
}, [window.ethereum]);

const _destNetworks = [chain];
const _defaultDestNetwork = _destNetworks[0];

return (
<div className="skt-w bg-gray-400 p-10" style={{ height: "calc(100vh - 40px)" }}>
<p style={{ color: "black" }}>
Expand Down
Loading

0 comments on commit e0bb0d5

Please sign in to comment.