* Stop GasFeeController polling when pop closes
* Stop estimate gas polling on window unload
* lint + comments
* Improve client closed logic
* lint
* Add back _beforeUnload on unmount in gas-modal-page-container
* Add full check and call onClientClosed method for notifcation environment
* Add gas pollingToken tracking to appStateController and use to disconnect polling for each environment type
* remove unused method
* move controller manipulation logic from background.js to metamask-controller, disaggregate methods
* add beforeunload handling to reset gas polling tokens from root of send page
* cleanup, lint and address feedback
* clear appState gasPollingTokens when all instances of all env types are closed, fix pollingTokenType arg from onEnvironmentTypeClosed call in metamask-controller
* mock new methods to fix tests
* final bit of cleanup + comments
Co-authored-by: Dan Miller <danjm.com@gmail.com>
* prepare for EIP1559 gas fields in speedup/cancel
* Update ui/components/app/gas-customization/gas-modal-page-container/gas-modal-page-container.container.js
* Fix gas-modal-page-container.container check for custom gas price safety
* Ensure gas price has been fetch before checking for price safety on testnets
* Use eth_gasPrice result for setting too low warning on custom networks
* Assume CustomPriceSafeForCustomNetwork when there is no custom price set (it will default to recommended)