Skip to content

[bug] Async methods don't return after Wallet dialogs cancelled #2

Description

@TechQuery

@MetisProtocol

Example

// expected
export async function requestSomething() {
    try {
        const result = await polisClient.someContract();

        return result;  // cancel doesn't resolve promise
    } catch (error) {
        console.log('Error or Cancelled');  // nor reject
    }
}

// actual
window.addEventListener('unhandledrejection', ({ reason }) => console.log(reason));

Possible resolution

Wrap inner promises of Wallet dialogs opening into returned promises.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions