MCPcopy Create free account
hub / github.com/Criptext/Criptext-Email-React-Client / cleanKeys

Function cleanKeys

electron_app/src/database/DBEmanager.js:1708–1734  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1706};
1707
1708const cleanKeys = async recipientId => {
1709 if (!recipientId || !getDB()) return;
1710 return await getDB().transaction(async trx => {
1711 const account = await Account().findOne({
1712 where: { recipientId },
1713 raw: true,
1714 transaction: trx
1715 });
1716 if (!account) return [];
1717 await Prekeyrecord().destroy({
1718 where: { accountId: account.id },
1719 transaction: trx
1720 });
1721 await Signedprekeyrecord().destroy({
1722 where: { accountId: account.id },
1723 transaction: trx
1724 });
1725 await Sessionrecord().destroy({
1726 where: { accountId: account.id },
1727 transaction: trx
1728 });
1729 await Identitykeyrecord().destroy({
1730 where: { accountId: account.id },
1731 transaction: trx
1732 });
1733 });
1734};
1735
1736const clearAndFormatDateEmails = emailObjOrArray => {
1737 let tempArr = [];

Callers

nothing calls this directly

Calls 6

getDBFunction · 0.85
PrekeyrecordClass · 0.85
SignedprekeyrecordClass · 0.85
SessionrecordClass · 0.85
IdentitykeyrecordClass · 0.85
AccountClass · 0.70

Tested by

no test coverage detected