MCPcopy
hub / github.com/mailvelope/mailvelope / init

Function init

src/modules/keyring.js:103–125  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

101let keyringFirstTimeLoad;
102
103export async function init() {
104 keyringMap.clear();
105 keyringAttr.clear();
106 await keyringAttr.init();
107 const keyringIds = Array.from(keyringAttr.keys());
108 await Promise.all(keyringIds.map(async keyringId => {
109 if (keyringId === GNUPG_KEYRING_ID) {
110 return;
111 }
112 try {
113 await buildKeyring(keyringId);
114 await sanitizeKeyring(keyringId);
115 } catch (e) {
116 // could not build keyring, remove from keyring attributes
117 await keyringAttr.delete(keyringId);
118 console.log(`Building keyring for id ${keyringId} failed`, e);
119 }
120 }));
121 keyringFirstTimeLoad = await firstTimeLoad();
122 keyringFirstTimeLoad ? initGPG() : await initGPG();
123 keyringInitDone();
124 preVerifyKeys();
125}
126
127async function initGPG() {
128 await keyringAttr.initGPG();

Callers 1

setupKeyringFunction · 0.90

Calls 8

buildKeyringFunction · 0.85
sanitizeKeyringFunction · 0.85
firstTimeLoadFunction · 0.85
initGPGFunction · 0.85
preVerifyKeysFunction · 0.85
clearMethod · 0.45
initMethod · 0.45
deleteMethod · 0.45

Tested by

no test coverage detected