This commit is contained in:
parent
6212f47084
commit
af872d538c
1 changed files with 3 additions and 10 deletions
|
@ -171,10 +171,7 @@ function buildActivityHTML(activity) {
|
||||||
? `<div class="activity-buttons">
|
? `<div class="activity-buttons">
|
||||||
${activity.buttons
|
${activity.buttons
|
||||||
.map((button, index) => {
|
.map((button, index) => {
|
||||||
const label =
|
const label = typeof button === "string" ? button : button.label;
|
||||||
typeof button === "string"
|
|
||||||
? button
|
|
||||||
: button.label;
|
|
||||||
let url = null;
|
let url = null;
|
||||||
if (typeof button === "object" && button.url) {
|
if (typeof button === "object" && button.url) {
|
||||||
url = button.url;
|
url = button.url;
|
||||||
|
@ -326,9 +323,7 @@ async function populateReadme(data) {
|
||||||
if (readmeSection && data.kv?.readme) {
|
if (readmeSection && data.kv?.readme) {
|
||||||
const url = data.kv.readme;
|
const url = data.kv.readme;
|
||||||
try {
|
try {
|
||||||
const res = await fetch(
|
const res = await fetch(`/api/readme?url=${encodeURIComponent(url)}`);
|
||||||
`/api/readme?url=${encodeURIComponent(url)}`,
|
|
||||||
);
|
|
||||||
if (!res.ok) throw new Error("Failed to fetch readme");
|
if (!res.ok) throw new Error("Failed to fetch readme");
|
||||||
|
|
||||||
const text = await res.text();
|
const text = await res.text();
|
||||||
|
@ -348,9 +343,7 @@ async function updatePresence(data) {
|
||||||
const cssLink = data.kv?.css;
|
const cssLink = data.kv?.css;
|
||||||
if (cssLink) {
|
if (cssLink) {
|
||||||
try {
|
try {
|
||||||
const res = await fetch(
|
const res = await fetch(`/api/css?url=${encodeURIComponent(cssLink)}`);
|
||||||
`/api/css?url=${encodeURIComponent(cssLink)}`,
|
|
||||||
);
|
|
||||||
if (!res.ok) throw new Error("Failed to fetch CSS");
|
if (!res.ok) throw new Error("Failed to fetch CSS");
|
||||||
|
|
||||||
const cssText = await res.text();
|
const cssText = await res.text();
|
||||||
|
|
Loading…
Add table
Reference in a new issue