add boolean to web3.reset()
This commit is contained in:
parent
0d1bcdfd2a
commit
4b3aa701b9
|
@ -109,8 +109,8 @@ web3.setProvider = function (provider) {
|
|||
web3.isConnected = function(){
|
||||
return (this.currentProvider && this.currentProvider.isConnected());
|
||||
};
|
||||
web3.reset = function () {
|
||||
RequestManager.getInstance().reset();
|
||||
web3.reset = function (keepIsSyncing) {
|
||||
RequestManager.getInstance().reset(keepIsSyncing);
|
||||
c.defaultBlock = 'latest';
|
||||
c.defaultAccount = undefined;
|
||||
};
|
||||
|
|
|
@ -177,11 +177,11 @@ RequestManager.prototype.stopPolling = function (pollId) {
|
|||
*
|
||||
* @method reset
|
||||
*/
|
||||
RequestManager.prototype.reset = function () {
|
||||
RequestManager.prototype.reset = function (keepIsSyncing) {
|
||||
for (var key in this.polls) {
|
||||
// remove all polls, except sync polls,
|
||||
// they need to be removed manually by calling syncing.stopWatching()
|
||||
if(key.indexOf('syncPoll_') === -1) {
|
||||
if(!keepIsSyncing || key.indexOf('syncPoll_') === -1) {
|
||||
this.polls[key].uninstall();
|
||||
delete this.polls[key];
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue