mirror of
https://github.com/cheeaun/phanpy.git
synced 2024-11-28 12:18:51 +03:00
Fix instance url
Why do I need to keep doing this
This commit is contained in:
parent
3a4a75793a
commit
dcb24382fc
1 changed files with 8 additions and 0 deletions
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue