fix: fix anonymization client script

This commit is contained in:
tdurieux
2024-04-03 18:41:00 +01:00
parent 1d4bab7866
commit 795a67cdb2
+6 -13
View File
@@ -1050,9 +1050,7 @@ angular
$scope.options.expirationDate.getDate() + 90 $scope.options.expirationDate.getDate() + 90
); );
} }
await Promise.all([getDetails(), getReadme()]);
await getDetails();
await getReadme();
anonymize(); anonymize();
$scope.$apply(); $scope.$apply();
}, },
@@ -1091,8 +1089,7 @@ angular
return; return;
} }
try { try {
await getDetails(); await Promise.all([getDetails(), getReadme()]);
await getReadme();
anonymize(); anonymize();
} catch (error) {} } catch (error) {}
$scope.$apply(); $scope.$apply();
@@ -1187,18 +1184,15 @@ angular
async function getReadme(force) { async function getReadme(force) {
if ($scope.readme && !force) return $scope.readme; if ($scope.readme && !force) return $scope.readme;
const o = parseGithubUrl($scope.repoUrl); const o = parseGithubUrl($scope.repoUrl);
$http try {
.get(`/api/repo/${o.owner}/${o.repo}/readme`, { const res = await $http.get(`/api/repo/${o.owner}/${o.repo}/readme`, {
params: { params: {
force: force === true ? "1" : "0", force: force === true ? "1" : "0",
branch: $scope.source.branch, branch: $scope.source.branch,
}, },
}) });
.then(
(res) => {
$scope.readme = res.data; $scope.readme = res.data;
}, } catch (error) {
() => {
$scope.readme = ""; $scope.readme = "";
const toast = { const toast = {
title: `README not available...`, title: `README not available...`,
@@ -1207,7 +1201,6 @@ angular
}; };
$scope.toasts.push(toast); $scope.toasts.push(toast);
} }
);
} }
function getConference() { function getConference() {