mirror of
https://github.com/tdurieux/anonymous_github.git
synced 2026-07-03 04:16:01 +02:00
fix: fix anonymization client script
This commit is contained in:
+15
-22
@@ -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,27 +1184,23 @@ 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(
|
$scope.readme = res.data;
|
||||||
(res) => {
|
} catch (error) {
|
||||||
$scope.readme = res.data;
|
$scope.readme = "";
|
||||||
},
|
const toast = {
|
||||||
() => {
|
title: `README not available...`,
|
||||||
$scope.readme = "";
|
date: new Date(),
|
||||||
const toast = {
|
body: `The README of ${o.owner}/${o.repo} was not found.`,
|
||||||
title: `README not available...`,
|
};
|
||||||
date: new Date(),
|
$scope.toasts.push(toast);
|
||||||
body: `The README of ${o.owner}/${o.repo} was not found.`,
|
}
|
||||||
};
|
|
||||||
$scope.toasts.push(toast);
|
|
||||||
}
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function getConference() {
|
function getConference() {
|
||||||
|
|||||||
Reference in New Issue
Block a user