Adjustment to the request debug view functionality
This commit is contained in:
@@ -56,8 +56,11 @@ function createDebugContentLog({
|
||||
}
|
||||
|
||||
entries.forEach((entry) => {
|
||||
debugState.requestLog.push({
|
||||
id: debugState.requestLog.length + 1,
|
||||
const existing = entry.debugKey && debugState.requestLog.find(item => item.debugKey === entry.debugKey);
|
||||
if (existing && existing.status !== "pending" && entry.status === "pending") return;
|
||||
const normalized = {
|
||||
id: existing ? existing.id : debugState.requestLog.length + 1,
|
||||
debugKey: entry.debugKey,
|
||||
name: entry.name || "backgroundRequest",
|
||||
method: entry.method || "GET",
|
||||
url: entry.url || "",
|
||||
@@ -75,7 +78,9 @@ function createDebugContentLog({
|
||||
responseBody: entry.responseBody || "",
|
||||
responseBodyTruncated: Boolean(entry.responseBodyTruncated),
|
||||
error: entry.error || ""
|
||||
});
|
||||
};
|
||||
if (existing) Object.assign(existing, normalized);
|
||||
else debugState.requestLog.push(normalized);
|
||||
});
|
||||
renderDebugPanel();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user