fix temp cleanup
This commit is contained in:
parent
5773fa7408
commit
c66dc88962
@ -130,6 +130,10 @@ module.exports = class P2PStore extends EventEmitter {
|
|||||||
|
|
||||||
store(obj)
|
store(obj)
|
||||||
{
|
{
|
||||||
|
// clean temp from object
|
||||||
|
const temp = obj._temp
|
||||||
|
delete obj._temp
|
||||||
|
|
||||||
const value = {
|
const value = {
|
||||||
id: ++this.id,
|
id: ++this.id,
|
||||||
hash: objectHash(obj),
|
hash: objectHash(obj),
|
||||||
@ -137,10 +141,8 @@ module.exports = class P2PStore extends EventEmitter {
|
|||||||
index: obj._index,
|
index: obj._index,
|
||||||
peerId: this.p2p.peerId,
|
peerId: this.p2p.peerId,
|
||||||
myself: true,
|
myself: true,
|
||||||
temp: obj._temp
|
temp
|
||||||
}
|
}
|
||||||
if(obj._temp)
|
|
||||||
delete obj._temp
|
|
||||||
|
|
||||||
console.log('store object', value.id)
|
console.log('store object', value.id)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user