userscript/origin: do not show failed when no OriginConfig.

Rather it should be assumed that the project does not intend to have
origin information.
This commit is contained in:
Jimmy Berry 2019-05-13 17:36:35 -05:00
parent f246043497
commit ed26d9219d

View File

@ -22,7 +22,11 @@
$('ul.clean_list, ul.list-unstyled').append('<li id="osrt-origin"><i class="fas fa-spinner fa-spin text-info"></i> loading origin...</li>');
$.get({url: url, crossDomain: true, xhrFields: {withCredentials: true}, success: function(origin) {
if (origin.endsWith('failed')) {
$('#osrt-origin').html('<i class="fas fa-bug text-warning"></i> failed to get origin info');
if (origin.startsWith('OSRT:OriginConfig attribute missing')) {
$('#osrt-origin').html('');
} else {
$('#osrt-origin').html('<i class="fas fa-bug text-warning"></i> failed to get origin info');
}
} else {
project = origin.trim();
if (project.endsWith('~')) {