Skip to content
This repository has been archived by the owner on Aug 9, 2021. It is now read-only.

Commit

Permalink
fix: clear polling interval on shutdown (#724)
Browse files Browse the repository at this point in the history
* clear polling interval on shutdown

* remove DS_Store file from repo
  • Loading branch information
msterle authored Feb 28, 2020
1 parent b165902 commit 5ad3989
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,6 @@ dist/
coverage/
tmp/
.js-ipfs
.DS_Store
yarn.lock
orbitdb
5 changes: 4 additions & 1 deletion src/3id/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ class ThreeId {
this.events.emit(event, data)
})
}
setInterval(() => {
this._pollInterval = setInterval(() => {
poll('3id_newAuthMethodPoll', 'new-auth-method')
poll('3id_newLinkPoll', 'new-link-proof')
}, POLL_INTERVAL)
Expand Down Expand Up @@ -274,6 +274,9 @@ class ThreeId {

logout () {
localstorage.remove(STORAGE_KEY + this.managementAddress)
if (this._pollInterval) {
clearInterval(this._pollInterval)
}
}

static isLoggedIn (address) {
Expand Down

0 comments on commit 5ad3989

Please sign in to comment.