Skip to content

Commit

Permalink
Hotfix for WC2 crash issue + bump to 3.83
Browse files Browse the repository at this point in the history
  • Loading branch information
JamesSmartCell committed Jun 3, 2024
1 parent cc69ae6 commit ebae23c
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 7 deletions.
4 changes: 2 additions & 2 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,8 @@ android {
applicationId "io.stormbird.wallet"
minSdk 24
targetSdk 34
versionCode 267
versionName "3.82"
versionCode 268
versionName "3.83"

android.buildFeatures.buildConfig true

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import android.os.Parcel;
import android.os.Parcelable;
import android.text.TextUtils;

import com.walletconnect.web3.wallet.client.Wallet;

Expand All @@ -20,9 +21,9 @@ public class WalletConnectV2SessionItem extends WalletConnectSessionItem impleme
public WalletConnectV2SessionItem(Wallet.Model.Session s)
{
super();
name = Objects.requireNonNull(s.getMetaData()).getName();
url = Objects.requireNonNull(s.getMetaData()).getUrl();
icon = s.getMetaData().getIcons().isEmpty() ? null : s.getMetaData().getIcons().get(0);
name = s.getMetaData() != null && !TextUtils.isEmpty((s.getMetaData()).getName()) ? (s.getMetaData()).getName() : "";
url = s.getMetaData() != null && !TextUtils.isEmpty((s.getMetaData()).getName()) ? (s.getMetaData()).getUrl() : "";
icon = s.getMetaData() != null && !s.getMetaData().getIcons().isEmpty() ? s.getMetaData().getIcons().get(0) : null;
sessionId = s.getTopic();
localSessionId = s.getTopic();
settled = true;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package com.alphawallet.app.interact;

import android.text.TextUtils;

import com.alphawallet.app.entity.walletconnect.WalletConnectSessionItem;
import com.alphawallet.app.entity.walletconnect.WalletConnectV2SessionItem;
import com.walletconnect.web3.wallet.client.Wallet;
Expand Down Expand Up @@ -51,10 +53,13 @@ private List<WalletConnectSessionItem> getWalletConnectV2SessionItems()
List<WalletConnectSessionItem> result = new ArrayList<>();
try
{
List<Wallet.Model.Session> listOfSettledSessions = Web3Wallet.INSTANCE.getListOfActiveSessions();
List<Wallet.Model.Session> listOfSettledSessions = Web3Wallet.getListOfActiveSessions();
for (Wallet.Model.Session session : listOfSettledSessions)
{
result.add(new WalletConnectV2SessionItem(session));
if (session.getMetaData() != null && !(TextUtils.isEmpty(session.getMetaData().name) && TextUtils.isEmpty(session.getMetaData().url)))
{
result.add(new WalletConnectV2SessionItem(session));
}
}
}
catch (IllegalStateException e)
Expand Down

0 comments on commit ebae23c

Please sign in to comment.