Merge pull request #81 from shocknet/gc-gun

garbage collect gun
This commit is contained in:
Daniel Lugo 2020-06-22 12:47:44 -04:00 committed by GitHub
commit 59993e28b6

View file

@ -328,6 +328,17 @@ const logoff = () => {
}
const instantiateGun = () => {
if (user) {
user.leave()
}
// @ts-ignore
user = null
if (gun) {
gun.off()
}
// @ts-ignore
gun = null
const _gun = /** @type {unknown} */ (new Gun({
axe: false,
peers: Config.PEERS