Merge pull request #475 from shocknet/init-hotfix
Remove unneded follows init
This commit is contained in:
commit
6d3d140f6b
1 changed files with 0 additions and 70 deletions
|
|
@ -14,7 +14,6 @@ require('gun/lib/open')
|
||||||
require('gun/lib/load')
|
require('gun/lib/load')
|
||||||
//@ts-ignore
|
//@ts-ignore
|
||||||
const { encryptedEmit, encryptedOn } = require('../../../utils/ECC/socket')
|
const { encryptedEmit, encryptedOn } = require('../../../utils/ECC/socket')
|
||||||
const Key = require('../contact-api/key')
|
|
||||||
|
|
||||||
/** @type {import('../contact-api/SimpleGUN').ISEA} */
|
/** @type {import('../contact-api/SimpleGUN').ISEA} */
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
|
|
@ -328,29 +327,6 @@ const authenticate = async (alias, pass, __user) => {
|
||||||
// clock skew
|
// clock skew
|
||||||
await new Promise(res => setTimeout(res, 2000))
|
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
|
return ack.sea.pub
|
||||||
} else {
|
} else {
|
||||||
throw new Error('Unknown error.')
|
throw new Error('Unknown error.')
|
||||||
|
|
@ -367,29 +343,6 @@ const authenticate = async (alias, pass, __user) => {
|
||||||
// clock skew
|
// clock skew
|
||||||
await new Promise(res => setTimeout(res, 2000))
|
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
|
// move this to a subscription; implement off() ? todo
|
||||||
API.Jobs.onOrders(_user, gun, mySEA)
|
API.Jobs.onOrders(_user, gun, mySEA)
|
||||||
API.Jobs.lastSeenNode(_user)
|
API.Jobs.lastSeenNode(_user)
|
||||||
|
|
@ -424,29 +377,6 @@ const authenticate = async (alias, pass, __user) => {
|
||||||
|
|
||||||
await new Promise(res => setTimeout(res, 5000))
|
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.onOrders(_user, gun, mySEA)
|
||||||
API.Jobs.lastSeenNode(_user)
|
API.Jobs.lastSeenNode(_user)
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue