fix: remove unused import and guard URL parsing in AddDmMemberModal
Remove unused TaggedFriend type import. Wrap new URL() in try/catch for federation origin display to handle malformed _instanceOrigin.
This commit is contained in:
@@ -5,7 +5,7 @@ import { Avatar } from '../ui/Avatar';
|
|||||||
import { useUIStore } from '../../stores/uiStore';
|
import { useUIStore } from '../../stores/uiStore';
|
||||||
import { useSpaceStore } from '../../stores/spaceStore';
|
import { useSpaceStore } from '../../stores/spaceStore';
|
||||||
import { useAuthStore } from '../../stores/authStore';
|
import { useAuthStore } from '../../stores/authStore';
|
||||||
import { useSocialStore, type TaggedFriend } from '../../stores/socialStore';
|
import { useSocialStore } from '../../stores/socialStore';
|
||||||
import { api } from '../../api/client';
|
import { api } from '../../api/client';
|
||||||
import { isSelf } from '../../utils/identity';
|
import { isSelf } from '../../utils/identity';
|
||||||
|
|
||||||
@@ -224,7 +224,7 @@ export function AddDmMemberModal() {
|
|||||||
: friend.username.includes('@')
|
: friend.username.includes('@')
|
||||||
? `@${friend.username}`
|
? `@${friend.username}`
|
||||||
: friend._instanceOrigin
|
: friend._instanceOrigin
|
||||||
? `@${friend.username}@${new URL(friend._instanceOrigin).host}`
|
? `@${friend.username}@${(() => { try { return new URL(friend._instanceOrigin).host; } catch { return friend._instanceOrigin; } })()}`
|
||||||
: `@${friend.username}`}
|
: `@${friend.username}`}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user