mirror of
https://github.com/tdurieux/anonymous_github.git
synced 2026-05-15 22:48:00 +02:00
Improve error handling
This commit is contained in:
@@ -141,7 +141,7 @@
|
||||
|
||||
<div class="form-group">
|
||||
<label class="paper-field-label" for="conference">Conference <span class="paper-optional">(optional)</span></label>
|
||||
<input class="form-control" id="conference" name="conference" ng-model="conference" ng-class="{'is-invalid': anonymize.conference.$invalid}" />
|
||||
<input class="form-control" id="conference" name="conference" ng-model="conference" ng-model-options="{ debounce: { default: 800, blur: 0 }, updateOn: 'default blur' }" ng-class="{'is-invalid': anonymize.conference.$invalid}" />
|
||||
<small class="form-text text-muted" ng-show="conference_data">
|
||||
<a ng-href="{{conference_data.url}}" target="_blank">{{conference_data.name}}</a> expires {{conference_data.endDate | date}}.
|
||||
</small>
|
||||
|
||||
@@ -90,6 +90,7 @@
|
||||
id="conference"
|
||||
name="conference"
|
||||
ng-model="conference"
|
||||
ng-model-options="{ debounce: { default: 800, blur: 0 }, updateOn: 'default blur' }"
|
||||
ng-class="{'is-invalid': anonymize.conference.$invalid}"
|
||||
/>
|
||||
<small class="form-text text-muted" ng-show="conference_data"
|
||||
|
||||
+17
-2
@@ -1598,7 +1598,18 @@ angular
|
||||
}
|
||||
const selected = $scope.branches.filter((b) => b.name == $scope.source.branch);
|
||||
if (selected.length > 0) {
|
||||
$scope.source.commit = selected[0].commit;
|
||||
// Preserve the saved commit when editing with auto-update off:
|
||||
// refreshing branches must not silently bump the pinned SHA to
|
||||
// GitHub HEAD. Same intent as the source.branch watcher (#360),
|
||||
// extended to cover the branches refresh path.
|
||||
const keepSavedCommit =
|
||||
$scope.isUpdate &&
|
||||
!$scope.options.update &&
|
||||
$scope._originalBranch === $scope.source.branch &&
|
||||
!!$scope.source.commit;
|
||||
if (!keepSavedCommit) {
|
||||
$scope.source.commit = selected[0].commit;
|
||||
}
|
||||
$scope.readme = selected[0].readme;
|
||||
await getReadme(force);
|
||||
}
|
||||
@@ -2258,7 +2269,7 @@ angular
|
||||
return res.data;
|
||||
} catch (err) {
|
||||
$scope.type = "error";
|
||||
$scope.content = err.data.error;
|
||||
$scope.content = (err && err.data && err.data.error) || "unknown_error";
|
||||
$scope.files = [];
|
||||
}
|
||||
};
|
||||
@@ -2567,6 +2578,10 @@ angular
|
||||
for (let i = 0; i < $scope.paths.length; i++) {
|
||||
const path = i > 0 ? $scope.paths.slice(0, i).join("/") : "";
|
||||
await $scope.getFiles(path);
|
||||
if ($scope.type === "error") {
|
||||
$scope.$apply();
|
||||
return;
|
||||
}
|
||||
}
|
||||
if ($scope.files.length == 1 && $scope.files[0].name == "") {
|
||||
$scope.files = [];
|
||||
|
||||
Vendored
+1
-1
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user