repo card: fix error with uriEncoding
This commit is contained in:
@@ -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 = {
|
||||
|
||||
@@ -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
@@ -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;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user