From b30e260f602c1fef54058f70139ba48c3b6d3042 Mon Sep 17 00:00:00 2001 From: turbocrime Date: Fri, 23 Aug 2024 16:56:32 -0700 Subject: [PATCH] comment --- .../src/content-scripts/injected-penumbra-global.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/apps/extension/src/content-scripts/injected-penumbra-global.ts b/apps/extension/src/content-scripts/injected-penumbra-global.ts index 1abb261f..49c44ef0 100644 --- a/apps/extension/src/content-scripts/injected-penumbra-global.ts +++ b/apps/extension/src/content-scripts/injected-penumbra-global.ts @@ -57,7 +57,14 @@ class PraxInjection { private stateEvents = new EventTarget(); private injection: Readonly = Object.freeze({ + /** + * Meet the 'request' method of the old page API to mitigate incompatibility + * with pd v0.80.0's bundled minifront. This prevents connection failure. + * @todo Remove when bundled frontends are updated beyond `a31d54a` + * @issue https://github.com/prax-wallet/web/issues/175 + */ request: () => this.postConnectRequest().then(() => Promise.resolve()), + connect: () => Promise.resolve(this.port ?? this.postConnectRequest()), disconnect: () => this.postDisconnectRequest(), isConnected: () => Boolean(this.port && this.presentState === PenumbraState.Connected),