Fix business plans
This commit is contained in:
@@ -3095,7 +3095,16 @@
|
||||
}
|
||||
setCardLoading(card, true);
|
||||
try {
|
||||
const response = await fetch(thread.dataset.draftsUrl + "?" + queryParams().toString(), {
|
||||
const params = queryParams();
|
||||
try {
|
||||
const current = new URL(window.location.href);
|
||||
if (String(current.searchParams.get("nocache") || "").trim() === "1") {
|
||||
params.set("nocache", "1");
|
||||
}
|
||||
} catch (err) {
|
||||
// Ignore URL parse errors.
|
||||
}
|
||||
const response = await fetch(thread.dataset.draftsUrl + "?" + params.toString(), {
|
||||
method: "GET",
|
||||
credentials: "same-origin",
|
||||
headers: { Accept: "application/json" }
|
||||
@@ -3109,6 +3118,12 @@
|
||||
const drafts = Array.isArray(payload.drafts) ? payload.drafts : [];
|
||||
const container = card.querySelector(".compose-ai-content");
|
||||
container.innerHTML = "";
|
||||
const sourceTag = document.createElement("p");
|
||||
sourceTag.className = "is-size-7 has-text-grey";
|
||||
const source = String(payload.source || "unknown");
|
||||
const cachedLabel = payload.cached ? "cache" : "live";
|
||||
sourceTag.textContent = "Source: " + source + " (" + cachedLabel + ")";
|
||||
container.appendChild(sourceTag);
|
||||
const engageButton = document.createElement("button");
|
||||
engageButton.type = "button";
|
||||
engageButton.className = "button is-link is-light compose-draft-option";
|
||||
|
||||
Reference in New Issue
Block a user