MCPcopy Index your code
hub / github.com/Criptext/Criptext-Email-React-Client / createClient

Function createClient

electron_app/src/clientManager.js:52–79  ·  view source on GitHub ↗
({ recipientId, optionalToken })

Source from the content-addressed store, hash-verified

50};
51
52const createClient = async ({ recipientId, optionalToken }) => {
53 const client = clientsMap[recipientId];
54 if (client) return client;
55 const language = mySettings.language;
56 const osAndArch = await getOsAndArch();
57 const osInfo = Object.values(osAndArch)
58 .filter(val => !!val)
59 .join(' ');
60 if (optionalToken) {
61 return initializeClient({
62 recipientId,
63 token: optionalToken,
64 language,
65 os: osInfo
66 });
67 }
68 const [account] = await dbManager.getAccountByParams({ recipientId });
69 const [token, refreshToken] = account
70 ? [account.jwt, account.refreshToken]
71 : [undefined, undefined];
72 return initializeClient({
73 recipientId,
74 token,
75 refreshToken,
76 language,
77 os: osInfo
78 });
79};
80
81const getRecipientId = data => {
82 const { recipientId, domain } = data;

Callers 15

checkExpiredSessionFunction · 0.70
activateAddressFunction · 0.70
acknowledgeEventsFunction · 0.70
blockRemoteContentFunction · 0.70
canLoginFunction · 0.70
canSendFunction · 0.70
changeRecoveryEmailFunction · 0.70
changePasswordFunction · 0.70
checkAvailableUsernameFunction · 0.70
deleteAddressFunction · 0.70
deleteDeviceTokenFunction · 0.70
deleteDomainFunction · 0.70

Calls 2

initializeClientFunction · 0.70
getOsAndArchFunction · 0.50

Tested by

no test coverage detected