Skip to content

Commit 3a65973

Browse files
committed
feat: add lock comment
1 parent bc9f7e9 commit 3a65973

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

packages/inpage/setup-inpage-provider.js

+2
Original file line numberDiff line numberDiff line change
@@ -93,10 +93,12 @@ function setupProvider() {
9393
})
9494

9595
window.fluent = PROVIDER
96+
// do not lock window.ethereum if it's not defined
9697
if (!window.ethereum) window.ethereum = PROVIDER
9798
Object.defineProperty(window, 'conflux', {value: PROVIDER, writable: false})
9899
if (window.localStorage.getItem(FLUENT_OVERRIDE_WINDOW_DOT_ETHEREUM)) {
99100
try {
101+
// only lock window.ethereum when priority connection is enabled
100102
Object.defineProperty(window, 'ethereum', {
101103
value: PROVIDER,
102104
writable: false,

0 commit comments

Comments
 (0)