MCPcopy
hub / github.com/mailvelope/mailvelope / push

Function push

src/modules/uiLog.js:19–40  ·  view source on GitHub ↗
(source, type, substitutions, userAction = true)

Source from the content-addressed store, hash-verified

17 * @param {Boolean} [userAction=true] - this log entry is the result of a direct user interaction on the Mailvelope UI
18 */
19export function push(source, type, substitutions, userAction = true) {
20 const entry = {
21 source,
22 sourcei18n: l10n.get(source),
23 type,
24 typei18n: l10n.get(type, substitutions),
25 timestamp: (new Date()).toISOString()
26 };
27 const lastEntry = log[log.length - 1];
28 if (lastEntry &&
29 source === lastEntry.source &&
30 type === lastEntry.type &&
31 (type === 'security_log_textarea_input' || type === 'security_log_password_input')) {
32 // aggregate text input events
33 log[log.length - 1] = entry;
34 } else {
35 log.push(entry);
36 }
37 if (userAction) {
38 showIndicator();
39 }
40}
41
42function showIndicator(duration = 2000) {
43 if (logTimer) {

Callers

nothing calls this directly

Calls 3

showIndicatorFunction · 0.85
getMethod · 0.45
pushMethod · 0.45

Tested by

no test coverage detected