This commit is contained in:
Lilith Ashley Nyx Arson 🔥 2024-10-24 15:00:36 +02:00
parent c33241bfbd
commit adda611985
Signed by: lilith
SSH key fingerprint: SHA256:LAjgsAMyT3LO2JVtr6fQ4N3RTYoRRlIm5wAKsbDife4

View file

@ -216,14 +216,18 @@ function createSettingElement(key, [label, value, editable]) {
}
var res = await api("repos/migrate", _data);
var resp = JSON.parse(res);
try {
var resp = JSON.parse(res);
if (resp.message) {
if (resp.message == "The repository with the same name already exists.") {
window.open(`${config.instance}/mirrors/${repo}`);
} else alert(resp.message);
} else {
window.open(resp.html_url);
if (resp.message) {
if (resp.message == "The repository with the same name already exists.") {
window.open(`${config.instance}/mirrors/${repo}`);
} else alert(resp.message);
} else {
window.open(resp.html_url);
}
} catch (err) {
alert(err);
}
};