repo card: fix error with uriEncoding

This commit is contained in:
martin-mfg
2025-05-23 19:47:41 +02:00
parent aaa7a407f1
commit 8415848d13
3 changed files with 4 additions and 4 deletions
+1 -1
View File
@@ -105,7 +105,7 @@ const renderRepoCard = (repo, options = {}) => {
translations: repoCardLocales,
});
let repoFilter = buildSearchFilter([nameWithOwner], []);
let repoFilter = encodeURIComponent(buildSearchFilter([nameWithOwner], []));
const STATS = {};
if (show.includes("prs_authored")) {
STATS.prs_authored = {
+1 -1
View File
@@ -352,7 +352,7 @@ const renderStatsCard = (stats, options = {}, username, repos=[], owners=[]) =>
};
}
let repoFilter = buildSearchFilter(repos, owners);
let repoFilter = encodeURIComponent(buildSearchFilter([nameWithOwner], []));
if (show.includes("prs_authored")) {
STATS.prs_authored = {
icon: icons.prs,
+2 -2
View File
@@ -220,11 +220,11 @@ const fallbackColor = (color, fallbackColor) => {
const buildSearchFilter = (repos = [], owners = []) => {
let repoFilter =
Array.isArray(repos) && repos.length > 0
? repos.map((r) => `repo%3A${encodeURIComponent(r)}`).join("+") + "+"
? repos.map((r) => `repo:${r} `).join("")
: "";
let orgFilter =
Array.isArray(owners) && owners.length > 0
? owners.map((o) => `owner%3A${encodeURIComponent(o)}`).join("+") + "+"
? owners.map((o) => `owner:${o} `).join("")
: "";
return repoFilter + orgFilter;
};