avatar now inside of profileBinary subnode, remove poll endpoint
This commit is contained in:
parent
6f835344ae
commit
32d7af3621
5 changed files with 5 additions and 26 deletions
|
|
@ -815,7 +815,7 @@ const setAvatar = (avatar, user) =>
|
|||
}
|
||||
|
||||
user
|
||||
.get(Key.PROFILE)
|
||||
.get(Key.PROFILE_BINARY)
|
||||
.get(Key.AVATAR)
|
||||
.put(avatar, ack => {
|
||||
if (ack.err && typeof ack.err !== 'number') {
|
||||
|
|
|
|||
|
|
@ -114,7 +114,7 @@ const onAvatar = (cb, user) => {
|
|||
if (!avatarSubbed) {
|
||||
avatarSubbed = true
|
||||
user
|
||||
.get(Key.PROFILE)
|
||||
.get(Key.PROFILE_BINARY)
|
||||
.get(Key.AVATAR)
|
||||
.on(avatar => {
|
||||
if (typeof avatar === 'string' || avatar === null) {
|
||||
|
|
|
|||
|
|
@ -60,3 +60,5 @@ exports.POSTS = 'posts'
|
|||
exports.TOTAL_TIPS = 'totalTips'
|
||||
|
||||
exports.TIPS_PAYMENT_STATUS = 'tipsPaymentStatus'
|
||||
|
||||
exports.PROFILE_BINARY = 'profileBinary'
|
||||
|
|
|
|||
|
|
@ -34,7 +34,7 @@ const onAvatar = (cb, pub) => {
|
|||
require('../../Mediator')
|
||||
.getGun()
|
||||
.user(pub)
|
||||
.get(Key.PROFILE)
|
||||
.get(Key.PROFILE_BINARY)
|
||||
.get(Key.AVATAR)
|
||||
.on(av => {
|
||||
if (typeof av === 'string' || av === null) {
|
||||
|
|
|
|||
|
|
@ -2107,29 +2107,6 @@ module.exports = async (
|
|||
}
|
||||
})
|
||||
|
||||
app.get(`/api/gun/${GunEvent.ON_AVATAR}`, async (_, res) => {
|
||||
try {
|
||||
const user = require('../services/gunDB/Mediator').getUser()
|
||||
const data = await timeout5(
|
||||
user
|
||||
.get(Key.PROFILE)
|
||||
.get(Key.AVATAR)
|
||||
.then()
|
||||
)
|
||||
res.json({
|
||||
data
|
||||
})
|
||||
} catch (err) {
|
||||
logger.info('Error in Avatar poll:')
|
||||
logger.error(err)
|
||||
res
|
||||
.status(err.message === Common.Constants.ErrorCode.NOT_AUTH ? 401 : 500)
|
||||
.json({
|
||||
errorMessage: typeof err === 'string' ? err : err.message
|
||||
})
|
||||
}
|
||||
})
|
||||
|
||||
app.get(`/api/gun/${GunEvent.ON_DISPLAY_NAME}`, async (_, res) => {
|
||||
try {
|
||||
const user = require('../services/gunDB/Mediator').getUser()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue