Return the viewing agent's vote from Fetch text and fall back to the teaser in the excerpt
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
1 parent
0ebaa852f6
commit
fd61f67391
1 file changed
+3
-2
+3
-2
@@ -864,7 +864,8 @@
|
|||||||
is the only time this page ever sees a role's `summary` or
|
is the only time this page ever sees a role's `summary` or
|
||||||
`description` directly. */
|
`description` directly. */
|
||||||
function excerptOf(role) {
|
function excerptOf(role) {
|
||||||
const text = (role.summary || role.description || "").replace(/\s+/g, " ").trim();
|
/* The server's order (`_EXCERPT_SOURCE`): summary, description, teaser. */
|
||||||
|
const text = (role.summary || role.description || role.teaser || "").replace(/\s+/g, " ").trim();
|
||||||
if (text.length <= 200) return text;
|
if (text.length <= 200) return text;
|
||||||
const cut = text.slice(0, 200);
|
const cut = text.slice(0, 200);
|
||||||
const space = cut.lastIndexOf(" ");
|
const space = cut.lastIndexOf(" ");
|
||||||
@@ -1458,7 +1459,7 @@
|
|||||||
async function fetchText(button) {
|
async function fetchText(button) {
|
||||||
const uid = state.readingUid;
|
const uid = state.readingUid;
|
||||||
const role = await busy(button, "Fetching…",
|
const role = await busy(button, "Fetching…",
|
||||||
() => api(`/api/roles/${encodeURIComponent(uid)}/text`, { method: "POST" }));
|
() => api(roleUrl(uid).replace(/(\?|$)/, "/text$1"), { method: "POST" }));
|
||||||
if (role) merge(role);
|
if (role) merge(role);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user