mirror of
https://github.com/cheeaun/phanpy.git
synced 2025-01-23 00:56:23 +01: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 = {};
|
const result = {};
|
||||||
data.forEach((value, key) => {
|
data.forEach((value, key) => {
|
||||||
result[key] = value?.trim();
|
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);
|
console.log('result', result);
|
||||||
if (!result.type) return;
|
if (!result.type) return;
|
||||||
|
|
Loading…
Reference in a new issue