From 6856a35cbd78d5c8687820b079c275529d7fdf39 Mon Sep 17 00:00:00 2001 From: Pawel-Szydlo Date: Fri, 15 Sep 2023 15:50:37 +0200 Subject: [PATCH] add call connect in signMessage --- packages/nightly/src/lib/injected-nightly.ts | 2 +- packages/nightly/src/lib/nightly.ts | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/packages/nightly/src/lib/injected-nightly.ts b/packages/nightly/src/lib/injected-nightly.ts index 52a20ff9c..99a386370 100644 --- a/packages/nightly/src/lib/injected-nightly.ts +++ b/packages/nightly/src/lib/injected-nightly.ts @@ -14,7 +14,7 @@ interface NightlyAccount { } export interface NearNightly { account: NightlyAccount; - connected: boolean; + isConnected: boolean; signMessage: (params: SignMessageParams) => Promise; signTransaction: ( transaction: NearTransaction diff --git a/packages/nightly/src/lib/nightly.ts b/packages/nightly/src/lib/nightly.ts index ecf78a2e6..238da134b 100644 --- a/packages/nightly/src/lib/nightly.ts +++ b/packages/nightly/src/lib/nightly.ts @@ -193,6 +193,10 @@ const Nightly: WalletBehaviourFactory = async ({ state, }); + if (_state.wallet.isConnected) { + await _state.wallet.connect(); + } + const signature = await _state.wallet.signMessage({ message, nonce,