@forge-connect/react 1.0.4 → 1.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +8 -6
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +8 -6
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -938,12 +938,14 @@ function WalletAdapterFlow() {
|
|
|
938
938
|
setLoading(true);
|
|
939
939
|
try {
|
|
940
940
|
wallet.select(w.adapter.name);
|
|
941
|
-
|
|
942
|
-
|
|
941
|
+
if (!w.adapter.connected) {
|
|
942
|
+
await w.adapter.connect();
|
|
943
|
+
}
|
|
944
|
+
const pk = w.adapter.publicKey;
|
|
943
945
|
if (!pk) throw new Error("Wallet did not provide a public key.");
|
|
944
946
|
const address = pk.toBase58();
|
|
945
947
|
const useCold = coldWalletRef.current;
|
|
946
|
-
const adapterSignMessage =
|
|
948
|
+
const adapterSignMessage = w.adapter.signMessage ? (msg) => w.adapter.signMessage(msg) : void 0;
|
|
947
949
|
await loginWithWallet(
|
|
948
950
|
address,
|
|
949
951
|
useCold ? void 0 : adapterSignMessage,
|
|
@@ -3595,11 +3597,11 @@ function WalletLinkStep({ onBack, onSuccess, onFatalError }) {
|
|
|
3595
3597
|
setLoading(true);
|
|
3596
3598
|
try {
|
|
3597
3599
|
wallet.select(w.adapter.name);
|
|
3598
|
-
await
|
|
3599
|
-
const pk =
|
|
3600
|
+
if (!w.adapter.connected) await w.adapter.connect();
|
|
3601
|
+
const pk = w.adapter.publicKey;
|
|
3600
3602
|
if (!pk) throw new Error("Wallet did not provide a public key.");
|
|
3601
3603
|
const useCold = coldWalletRef.current;
|
|
3602
|
-
const adapterSignMessage =
|
|
3604
|
+
const adapterSignMessage = w.adapter.signMessage ? (msg) => w.adapter.signMessage(msg) : void 0;
|
|
3603
3605
|
await linkWallet(
|
|
3604
3606
|
pk.toBase58(),
|
|
3605
3607
|
useCold ? void 0 : adapterSignMessage,
|