Skip to content

Commit

Permalink
fix: auth wall
Browse files Browse the repository at this point in the history
  • Loading branch information
veeso committed Feb 27, 2025
1 parent 1d85005 commit 152f270
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 10 deletions.
2 changes: 1 addition & 1 deletion eslint.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import reactRefresh from 'eslint-plugin-react-refresh';
import tseslint from 'typescript-eslint';

export default tseslint.config(
{ ignores: ['dist'] },
{ ignores: ['dist', '.dfx'] },
{
extends: [js.configs.recommended, ...tseslint.configs.recommended],
files: ['**/*.{ts,tsx}'],
Expand Down
9 changes: 0 additions & 9 deletions src/js/components/IcAuthWall.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@ const IcAuthWall = ({ children }: Props) => {
const { icWallet, setIcWallet, setAppError, agent, setAgent } =
useAppContext();

const [fetchedWallet, setFetchedWallet] = React.useState<boolean>(false);

const onSelectWallet = (wallet: WalletProvider) => {
if (setIcWallet) {
setIcWallet(wallet);
Expand All @@ -27,7 +25,6 @@ const IcAuthWall = ({ children }: Props) => {

React.useEffect(() => {
if (status === 'connected' && icWallet === undefined && setIcWallet) {
setFetchedWallet(true);
const storageWallet = getUserIcWallet();
if (storageWallet !== undefined) {
setIcWallet(storageWallet);
Expand All @@ -40,7 +37,6 @@ const IcAuthWall = ({ children }: Props) => {
status === 'notConnected' &&
setIcWallet !== undefined
) {
setFetchedWallet(true);
connect()
.then(() => {
setUserIcWallet(icWallet);
Expand All @@ -58,7 +54,6 @@ const IcAuthWall = ({ children }: Props) => {
setAgent !== undefined &&
setIcWallet !== undefined
) {
setFetchedWallet(true);
// get agent associated to this wallet
const principalStr = principal.toText();

Expand All @@ -78,10 +73,6 @@ const IcAuthWall = ({ children }: Props) => {
}
}, [icWallet, status, connect, principal, setAgent, setIcWallet]);

if (fetchedWallet === false) {
return null;
}

if (status === 'connected' && icWallet !== undefined && agent !== undefined) {
return <>{children}</>;
}
Expand Down

0 comments on commit 152f270

Please sign in to comment.