Base-Aepp hosted apps: Handling "Rejected by user" exceptions

Applications running under the base-aepp browser will get a “Confirm or cancel” full screen dialog for e.g: account access , opening channels or signing transactions. If the user clicks CANCEL , a promise rejection Rejected by user will be thrown.

How can hosted aepps catch this?

Thanks!

The Base app integrates SDK in a way that address() call on Aepp side resolves with Rejected by user exception in case if the user disallowed app to use current address.

You can check this version of example app: https://github.com/aeternity/aepp-sdk-js/pull/641. It shows Error: Rejected by user in the case if the user rejected account access.

1 Like