Merge pull request #475 from shocknet/init-hotfix

Remove unneded follows init
This commit is contained in:
CapDog 2021-09-18 15:50:26 -04:00 committed by GitHub
commit 6d3d140f6b

View file

@ -14,7 +14,6 @@ require('gun/lib/open')
require('gun/lib/load')
//@ts-ignore
const { encryptedEmit, encryptedOn } = require('../../../utils/ECC/socket')
const Key = require('../contact-api/key')
/** @type {import('../contact-api/SimpleGUN').ISEA} */
// @ts-ignore
@ -328,29 +327,6 @@ const authenticate = async (alias, pass, __user) => {
// clock skew
await new Promise(res => setTimeout(res, 2000))
await /** @type {Promise<void>} */ (new Promise((res, rej) => {
_user.get(Key.FOLLOWS).put(
{
unused: null
},
ack => {
if (ack.err && typeof ack.err !== 'number') {
rej(
new Error(
`Error initializing follows: ${JSON.stringify(
ack.err,
null,
4
)}`
)
)
} else {
res()
}
}
)
}))
return ack.sea.pub
} else {
throw new Error('Unknown error.')
@ -367,29 +343,6 @@ const authenticate = async (alias, pass, __user) => {
// clock skew
await new Promise(res => setTimeout(res, 2000))
await /** @type {Promise<void>} */ (new Promise((res, rej) => {
_user.get(Key.FOLLOWS).put(
{
unused: null
},
ack => {
if (ack.err && typeof ack.err !== 'number') {
rej(
new Error(
`Error initializing follows: ${JSON.stringify(
ack.err,
null,
4
)}`
)
)
} else {
res()
}
}
)
}))
// move this to a subscription; implement off() ? todo
API.Jobs.onOrders(_user, gun, mySEA)
API.Jobs.lastSeenNode(_user)
@ -424,29 +377,6 @@ const authenticate = async (alias, pass, __user) => {
await new Promise(res => setTimeout(res, 5000))
await /** @type {Promise<void>} */ (new Promise((res, rej) => {
_user.get(Key.FOLLOWS).put(
{
unused: null
},
ack => {
if (ack.err && typeof ack.err !== 'number') {
rej(
new Error(
`Error initializing follows: ${JSON.stringify(
ack.err,
null,
4
)}`
)
)
} else {
res()
}
}
)
}))
API.Jobs.onOrders(_user, gun, mySEA)
API.Jobs.lastSeenNode(_user)