-
Notifications
You must be signed in to change notification settings - Fork 5k
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
Add web3 shim usage notification #10039
Merged
Merged
Changes from 5 commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
4d35136
Add web3 shim usage alert state
rekmarks 5a60767
Settings and basic display UI logic
rekmarks 4538126
Cleanup alert background state, constants
rekmarks d555463
Implement web3 shim usage notification
rekmarks b7b3d3f
nodeify alert controller background hooks
rekmarks 661dd5f
Remove svg icon, again
rekmarks 9e74f97
Delete connect.svg file (unused)
rekmarks c854501
Tweak notification checkbox
rekmarks 995f518
Tweak alert controller initialization
rekmarks 6fd5a07
Add support article URL
rekmarks 4cb4bfa
Un-thunk alert 'action' creators
rekmarks File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
export const ALERT_TYPES = { | ||
unconnectedAccount: 'unconnectedAccount', | ||
web3ShimUsage: 'web3ShimUsage', | ||
invalidCustomNetwork: 'invalidCustomNetwork', | ||
} | ||
|
||
/** | ||
* Alerts that can be enabled or disabled by the user. | ||
*/ | ||
export const TOGGLEABLE_ALERT_TYPES = [ | ||
ALERT_TYPES.unconnectedAccount, | ||
ALERT_TYPES.web3ShimUsage, | ||
] | ||
|
||
export const WEB3_SHIM_USAGE_ALERT_STATES = { | ||
RECORDED: 1, | ||
DISMISSED: 2, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Q: should you just spread
...defaultState
beforealertEnabledness
and remove the empty objects here? That way if default state changes in the future it is easily extensible here? No strong opinions on this, it is safe the way it is.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.
actually, in retrospect -- do we want persistence for
web3ShimUsageOrigins
? Then we'd want to spreadinitState.web3ShimUsageOrigins
into the state declarationThere 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.
We don't want to persist
web3ShimUsageOrigins
, because we want dismissed web3 shim usage notifications to reappear if the extension is restarted (assuming the notification is enabled), and storing the origins could contribute to state bloat over time.Nevertheless, I followed your suggestion about spreading
defaultState
first, it's better!