Merge branch 'master' into feature/kredits-formatter

This commit is contained in:
2019-04-24 13:10:48 +00:00
committed by GitHub
7 changed files with 69 additions and 27 deletions

File diff suppressed because one or more lines are too long

View File

@@ -26,6 +26,7 @@ class Contributor {
url,
github_uid,
github_username,
gitea_username,
wiki_username,
} = this;
@@ -50,6 +51,14 @@ class Contributor {
});
}
if (gitea_username) {
data.accounts.push({
"site": "gitea.kosmos.org",
"username": gitea_username,
"url": `https://gitea.kosmos.org/${gitea_username}`
});
}
if (wiki_username) {
data.accounts.push({
"site": "wiki.kosmos.org",
@@ -87,13 +96,17 @@ class Contributor {
accounts,
} = JSON.parse(serialized.toString('utf8'));
let github_username, github_uid, wiki_username;
let github = accounts.find((a) => a.site === 'github.com');
let wiki = accounts.find((a) => a.site === 'wiki.kosmos.org');
let github_username, github_uid, gitea_username, wiki_username;
let github = accounts.find(a => a.site === 'github.com');
let gitea = accounts.find(a => a.site === 'gitea.kosmos.org');
let wiki = accounts.find(a => a.site === 'wiki.kosmos.org');
if (github) {
(({ username: github_username, uid: github_uid} = github));
}
if (gitea) {
(({ username: gitea_username } = gitea));
}
if (wiki) {
(({ username: wiki_username } = wiki));
}
@@ -105,6 +118,7 @@ class Contributor {
accounts,
github_uid,
github_username,
gitea_username,
wiki_username,
ipfsData: serialized,
};