Fix business plans

This commit is contained in:
2026-03-02 00:23:27 +00:00
parent b3e183eb0a
commit a9f5f3f75d
5 changed files with 117 additions and 9 deletions

View File

@@ -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";