socket on to generate wall
This commit is contained in:
parent
d1734a01c0
commit
0e01a1fe1a
1 changed files with 27 additions and 0 deletions
|
|
@ -510,6 +510,7 @@ class Mediator {
|
||||||
this.generateHandshakeNode
|
this.generateHandshakeNode
|
||||||
)
|
)
|
||||||
this.socket.on('GENERATE_ORDER_ADDRESS', this.generateOrderAddress)
|
this.socket.on('GENERATE_ORDER_ADDRESS', this.generateOrderAddress)
|
||||||
|
this.socket.on('INIT_FEED_WALL', this.initWall)
|
||||||
this.socket.on(Action.SEND_HANDSHAKE_REQUEST, this.sendHandshakeRequest)
|
this.socket.on(Action.SEND_HANDSHAKE_REQUEST, this.sendHandshakeRequest)
|
||||||
this.socket.on(
|
this.socket.on(
|
||||||
Action.SEND_HANDSHAKE_REQUEST_WITH_INITIAL_MSG,
|
Action.SEND_HANDSHAKE_REQUEST_WITH_INITIAL_MSG,
|
||||||
|
|
@ -772,6 +773,32 @@ class Mediator {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param {Readonly<{ token: string }>} body
|
||||||
|
*/
|
||||||
|
initWall = async body => {
|
||||||
|
try {
|
||||||
|
const { token } = body
|
||||||
|
|
||||||
|
await throwOnInvalidToken(token)
|
||||||
|
|
||||||
|
await API.Actions.initWall()
|
||||||
|
|
||||||
|
this.socket.emit('INIT_FEED_WALL', {
|
||||||
|
ok: true,
|
||||||
|
msg: null,
|
||||||
|
origBody: body
|
||||||
|
})
|
||||||
|
} catch (err) {
|
||||||
|
logger.info(err)
|
||||||
|
this.socket.emit('INIT_FEED_WALL', {
|
||||||
|
ok: false,
|
||||||
|
msg: err.message,
|
||||||
|
origBody: body
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Readonly<{ recipientPublicKey: string , token: string }>} body
|
* @param {Readonly<{ recipientPublicKey: string , token: string }>} body
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue