-
-
Notifications
You must be signed in to change notification settings - Fork 222
feat: Add option to hide return modal #1350
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
Conversation
57137f8 to
72edc58
Compare
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1350 +/- ##
==========================================
+ Coverage 74.93% 74.99% +0.05%
==========================================
Files 184 184
Lines 4513 4519 +6
Branches 1105 1108 +3
==========================================
+ Hits 3382 3389 +7
+ Misses 1131 1130 -1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
| this.state.hideReturnToAppModal = | ||
| hideReturnToAppModal ?? this.state.hideReturnToAppModal; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should the fallback be false? I guess I'm not clear if the goal here is to preserve a previous value on the same instance? Is that even possible? Won't this value clear once the stream is torn down?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It’s to fall back to the default value set in the state at line 29.
public state: RemoteCommunicationPostMessageStreamState = {
_name: null,
remote: null,
deeplinkProtocol: false,
hideReturnToAppModal: false,
platformManager: null,
};| connector?: RemoteCommunication; | ||
| qrcodeLink?: string; | ||
| useDeeplink?: boolean; | ||
| hideReturnToAppModal?: boolean; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nit] since this isn't a modal anymore I suppose we should make it more generic: hideReturnToAppNotification?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Totally agree :)
adonesky1
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
|
* feat: Add option to hide return modal * fix: review * fix: test * fix: lint * fix: test * fix: cursor comment MetaMask/metamask-sdk#1350 (comment)



Explanation
References
Checklist
Note
Introduces a new hideReturnToAppNotification option (default false) and passes it through to deeplink/QR URLs as hr=0/1; refactors SDK option initialization and updates tests.
hideReturnToAppNotification(defaultfalse) toMetaMaskSDKOptionsanddefaultMetaMaskSDKOptions.defaultMetaMaskSDKOptions; auto-filldappMetadata.urlif missing in web env.performSDKInitializationand expected options in tests.hideReturnToAppNotificationtoRemoteConnectionState; initialize fromsdk.options.startConnection, appendhr=0/1tolinkParamsand ensure it’s included forconnectWithflows; QR link reflectshr.hideReturnToAppNotificationtoRemoteCommunicationPostMessageStreamstate and constructor.getPostMessageStreamforwards the flag fromremoteConnection.state.write, includehr=0/1in deeplink URL params based onstate.hideReturnToAppNotification.hr=0/1in generated links.Written by Cursor Bugbot for commit 7caf78f. This will update automatically on new commits. Configure here.