Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix for wallet connect dialog issue #3350

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -688,8 +688,6 @@ protected void onSaveInstanceState(@NotNull Bundle state)
state.putLong("LASTID", lastId);
state.putString("PEERURL", peerUrl.getText().toString());
}

if (confirmationDialog != null) confirmationDialog.closingActionSheet();
}

private void setupClient(final String sessionId)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,6 @@ public class ActionSheetDialog extends BottomSheetDialog implements StandardFunc
private boolean actionCompleted;
private boolean use1559Transactions = false;
private Transaction transaction;
private boolean isAttached;

public ActionSheetDialog(@NonNull Activity activity, Web3Transaction tx, Token t,
String destName, String destAddress, TokensService ts,
Expand Down Expand Up @@ -171,7 +170,6 @@ else if (activity instanceof WalletConnectActivity)
}

setupCancelListeners();
isAttached = true;
}

public ActionSheetDialog(@NonNull Activity activity, ActionSheetCallback aCallback, SignAuthenticationCallback sCallback, Signable message)
Expand Down Expand Up @@ -214,7 +212,6 @@ public ActionSheetDialog(@NonNull Activity activity, ActionSheetCallback aCallba
functionBar.setupFunctions(this, new ArrayList<>(Collections.singletonList(R.string.action_confirm)));
functionBar.revealButtons();
setupCancelListeners();
isAttached = true;
}

public ActionSheetDialog(@NonNull Activity activity, ActionSheetCallback aCallback, int titleId, String message, int buttonTextId,
Expand Down Expand Up @@ -253,7 +250,6 @@ public ActionSheetDialog(@NonNull Activity activity, ActionSheetCallback aCallba
functionBar.setupFunctions(this, new ArrayList<>(Collections.singletonList(buttonTextId)));
functionBar.revealButtons();
setupCancelListeners();
isAttached = true;
}

// wallet connect request
Expand Down Expand Up @@ -284,7 +280,6 @@ public ActionSheetDialog(Activity activity, WCPeerMeta wcPeerMeta, long chainIdO
tokensService = null;
candidateTransaction = null;
callbackId = 0;
isAttached = true;
gasWidgetLegacy = null;
gasWidgetInterface = null;

Expand Down Expand Up @@ -339,7 +334,6 @@ public ActionSheetDialog(Activity activity, ActionSheetCallback aCallback, int t
functionBar.setupFunctions(this, new ArrayList<>(Collections.singletonList(buttonTextId)));
functionBar.revealButtons();
setupCancelListeners();
isAttached = true;
}

private GasWidgetInterface setupGasWidget()
Expand Down Expand Up @@ -638,7 +632,7 @@ private void showTransactionSuccess()

private void tryDismiss()
{
if (Utils.stillAvailable(activity) && isAttached && isShowing()) dismiss();
if (Utils.stillAvailable(activity) && isShowing()) dismiss();
}

private void updateRealmTransactionFinishEstimate(String txHash)
Expand Down Expand Up @@ -832,14 +826,9 @@ private void showAmount(BigInteger amountVal)
balanceDisplay.setNewBalanceText(token, getTransactionAmount(), networkFee, balanceAfterTransaction);
}

public void closingActionSheet()
{
isAttached = false;
}

public void success()
{
if (!activity.isFinishing() && !activity.isDestroyed() && isAttached)
if (!activity.isFinishing() && Utils.stillAvailable(activity) && isShowing())
{
confirmationWidget.completeProgressMessage(".", this::dismiss);
}
Expand Down