Fix instance url

Why do I need to keep doing this
pull/97/head
Lim Chee Aun 2023-04-19 10:42:26 +08:00
rodzic 3a4a75793a
commit dcb24382fc
1 zmienionych plików z 8 dodań i 0 usunięć

Wyświetl plik

@ -523,6 +523,14 @@ function ShortcutForm({
const result = {};
data.forEach((value, key) => {
result[key] = value?.trim();
if (key === 'instance') {
// Remove protocol and trailing slash
result[key] = result[key]
.replace(/^https?:\/\//, '')
.replace(/\/+$/, '');
// Remove @acct@ or acct@ from instance URL
result[key] = result[key].replace(/^@?[^@]+@/, '');
}
});
console.log('result', result);
if (!result.type) return;