fix(social-client): lowercase parsed @domain in sendFriendRequest
Hostnames are case-insensitive (RFC 4343), and both right-hand sides of the routing comparisons (window.location.host and URL.host) are already canonical lowercase. The user-typed domain substring was compared with strict ===, so ORBIT.ddns.net failed to match an existing connected peer and popped a spurious Connect Instance modal. Normalize at parse time.
This commit is contained in:
@@ -218,7 +218,8 @@ export const useSocialStore = create<SocialState>((set, get) => ({
|
||||
res = await api.social.sendRequest(username);
|
||||
} else {
|
||||
const baseName = username.slice(0, atIndex);
|
||||
const domain = username.slice(atIndex + 1);
|
||||
// Hostnames are case-insensitive; comparison RHS is canonical lowercase.
|
||||
const domain = username.slice(atIndex + 1).toLowerCase();
|
||||
|
||||
// Check if domain matches home instance
|
||||
if (domain === window.location.host) {
|
||||
|
||||
Reference in New Issue
Block a user