MCPcopy
hub / github.com/mailvelope/mailvelope / get

Method get

src/controller/main.controller.js:97–116  ·  view source on GitHub ↗
(id)

Source from the content-addressed store, hash-verified

95 }
96
97 async get(id) {
98 if (this.map.has(id)) {
99 return this.map.get(id);
100 }
101 const {[id]: ctrlSession} = await chrome.storage.session.get(id);
102 if (ctrlSession) {
103 const contrConstructor = getControllerClass(ctrlSession.mainType);
104 const ctrl = new contrConstructor();
105 ctrl.mainType = ctrlSession.mainType; // as mainType in the session might not be default mainType
106 ctrl.id = id;
107 ctrl.state = ctrlSession.state;
108 this.map.set(id, ctrl);
109 for (const peer of ctrlSession.peers) {
110 const peerCtrl = await this.get(peer.id);
111 ctrl.peers[peer.peerType] = peerCtrl;
112 peerCtrl.peers[ctrl.peerType] = ctrl;
113 }
114 return ctrl;
115 }
116 }
117
118 set(id, ctrl) {
119 this.map.set(id, ctrl);

Callers 15

initFunction · 0.45
initFunction · 0.45
AuthDomain.jsFile · 0.45
initFunction · 0.45
recoverySheet.jsFile · 0.45
initFunction · 0.45
initFunction · 0.45
ImportKey.jsFile · 0.45
initFunction · 0.45
initFunction · 0.45
initFunction · 0.45
DecryptMessage.jsFile · 0.45

Calls 3

getControllerClassFunction · 0.90
hasMethod · 0.45
setMethod · 0.45

Tested by

no test coverage detected