Remove reload from Share Address button (#6991)

* Update tooltip words for Share Address

* Don't forceReload anything on Share Address
feature/default_network_editable
Whymarrh Whitby 5 years ago committed by GitHub
parent ceace71bf5
commit 22b20837d4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      app/_locales/en/messages.json
  2. 8
      app/scripts/contentscript.js
  3. 2
      app/scripts/controllers/provider-approval.js
  4. 6
      app/scripts/metamask-controller.js

@ -6,7 +6,7 @@
"message": "Share your address to connect to $1?"
},
"shareAddressInfo": {
"message": "Sharing your address with $1 will allow you to interact with this dapp. This permission is to protect your privacy by default."
"message": "Sharing your address with $1 will allow you to interact with this dapp. This permission is to protect your privacy by default. You may need to reload the dapp for the change to take effect."
},
"privacyModeDefault": {
"message": "Privacy Mode is now enabled by default"

@ -114,7 +114,6 @@ function forwardTrafficBetweenMuxers (channelName, muxA, muxB) {
async function setupPublicApi (outStream) {
const api = {
forceReloadSite: (cb) => cb(null, forceReloadSite()),
getSiteMetadata: (cb) => cb(null, getSiteMetadata()),
}
const dnode = Dnode(api)
@ -307,10 +306,3 @@ async function domIsReady () {
// wait for load
await new Promise(resolve => window.addEventListener('DOMContentLoaded', resolve, { once: true }))
}
/**
* Reloads the site
*/
function forceReloadSite () {
window.location.reload()
}

@ -156,8 +156,6 @@ class ProviderApprovalController extends SafeEventEmitter {
dismissedOrigins: _dismissedOrigins,
providerRequests: remainingProviderRequests,
})
this.emit(`forceResolvedRequest:${origin}`, { approved: true, forced: true })
}
/**

@ -1273,8 +1273,6 @@ module.exports = class MetamaskController extends EventEmitter {
const publicApi = this.setupPublicApi(mux.createStream('publicApi'), originDomain)
this.setupProviderConnection(mux.createStream('provider'), originDomain, publicApi)
this.setupPublicConfig(mux.createStream('publicConfig'), originDomain)
this.providerApprovalController.on(`forceResolvedRequest:${originDomain}`, publicApi.forceReloadSite)
}
/**
@ -1455,10 +1453,6 @@ module.exports = class MetamaskController extends EventEmitter {
const publicApi = {
// wrap with an await remote
forceReloadSite: async () => {
const remote = await getRemote()
return await pify(remote.forceReloadSite)()
},
getSiteMetadata: async () => {
const remote = await getRemote()
return await pify(remote.getSiteMetadata)()

Loading…
Cancel
Save