Skip to content

Commit

Permalink
overwriting dummy with same _id
Browse files Browse the repository at this point in the history
  • Loading branch information
silkroadnomad committed Mar 26, 2024
1 parent d7b0f9a commit cd532bc
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/lib/network/p2p-operations.js
Original file line number Diff line number Diff line change
Expand Up @@ -466,12 +466,14 @@ export async function writeMyAddressIntoRequesterDB(requesterDB) {
try {
const writeFirstOfOurAddresses = _myAddressBook[0] //TODO use boolean flag "own" and a "tag" e.g. business or private to indicate which address should be written
delete writeFirstOfOurAddresses.own;

//delete the dummy which alice added for us!
const all = await requesterDB.all()
const foundDummy = all.filter((it) => {
return it.value.owner === _orbitdb?.identity?.id
})

writeFirstOfOurAddresses._id = foundDummy[foundDummyKey].value._id
// for (const foundDummyKey in foundDummy) {
// await requesterDB.del(foundDummy[foundDummyKey].key)
// }
Expand Down

0 comments on commit cd532bc

Please sign in to comment.