loadLogEntries function exported ✓ 100.0%

Last updated: 2026-03-01T23:25:47.125Z

Metrics

LOC: 14 Complexity: 4 Params: 0 Coverage: 100.0% (7/7 lines, 3x executed)

Signature

loadLogEntries(): : Promise<LogEntry[]>

Summary

Loads entries from chrome.storage.session (useful for late-opening UIs).

Source Code

export async function loadLogEntries(): Promise<LogEntry[]> {
  if (!hasSessionStorage()) return localEntries;

  try {
    const result = await chrome.storage.session.get(STORAGE_KEY);
    const stored = result[STORAGE_KEY] as LogEntry[] | undefined;
    if (Array.isArray(stored)) {
      localEntries = stored.slice(-maxEntries);
    }
  } catch {
    // Ignore — use local entries
  }
  return localEntries;
}

Dependencies (Outgoing)

graph LR loadLogEntries["loadLogEntries"] hasSessionStorage["hasSessionStorage"] loadLogEntries -->|calls| hasSessionStorage style loadLogEntries fill:#dbeafe,stroke:#2563eb,stroke-width:2px click loadLogEntries "62c6eec3d1dbde2c.html" click hasSessionStorage "a7e74519d0293203.html"
TargetType
hasSessionStorage calls
STORAGE_KEY dynamic_call

Impact (Incoming)

graph LR loadLogEntries["loadLogEntries"] LogViewerVariant["LogViewerVariant"] refresh["refresh"] LogViewerVariant -->|uses| loadLogEntries refresh -->|calls| loadLogEntries style loadLogEntries fill:#dbeafe,stroke:#2563eb,stroke-width:2px click loadLogEntries "62c6eec3d1dbde2c.html" click LogViewerVariant "3e8313bcae7abdc5.html" click refresh "f0f8b893cd35303a.html"
SourceType
LogViewerVariant uses
refresh calls