Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OnLogout & onError Portis event handlers not being called #138

Open
FlorianML opened this issue Oct 1, 2021 · 1 comment
Open

OnLogout & onError Portis event handlers not being called #138

FlorianML opened this issue Oct 1, 2021 · 1 comment

Comments

@FlorianML
Copy link

FlorianML commented Oct 1, 2021

Working with integrating Portis into my company's app. I'm able to pull the account using the implementation below but having issues fully logging out. After calling await portis.logout() it resolves with success: true but it does not trigger the onLogout callback. Instead I get an error (attached below) which also does not get communicated to the onError callback.

Reviewing the network activity, there are still calls being made from the widget after the provider has logged out so I'm unsure if the previous issue has anything to do with it

Code Snippet:

const { Portis } = window;

export async function getPortisAddresses() {
  let portis = new Portis(process.env.REACT_APP_PORTIS_ID, 'mainnet');

  portis.onLogout(() => {
    if (isDev()) {
      // eslint-disable-next-line no-console
      console.log('logging out');
    }
  });
  portis.onError((error) => {
    if (isDev()) {
      // eslint-disable-next-line no-console
      console.log('error occured', error);
    }
  });

  const accounts = await portis.provider.enable();

  // deactivate portis
 await portis.logout();

  portis = undefined;
  return accounts;
}

Error:
Screen Shot 2021-10-01 at 12 00 41 PM

@FlorianML FlorianML changed the title OnLogout && onError Portis event handlers not being called OnLogout & onError Portis event handlers not being called Oct 1, 2021
@fsobh
Copy link

fsobh commented Mar 16, 2022

Having the same issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants