chore(social-client): drop redundant comment, harden defineProperty

Per code-review:
- Drop the inline comment in sendFriendRequest; the commit message
  for the prior commit already covers the why and CLAUDE.md prefers
  no comments when the code is self-explanatory.
- Add writable: true to the window.location defineProperty in the
  test so re-firing beforeEach across jsdom version drift is safe.
This commit is contained in:
Jannis Braun
2026-04-25 19:29:06 +02:00
parent fba1f0b87d
commit 781e293cf7
2 changed files with 1 additions and 1 deletions
@@ -51,6 +51,7 @@ describe('socialStore.sendFriendRequest — case-insensitive domain routing', ()
// Override it for routing tests. // Override it for routing tests.
Object.defineProperty(window, 'location', { Object.defineProperty(window, 'location', {
configurable: true, configurable: true,
writable: true,
value: { ...window.location, host: 'local.test', hostname: 'local.test' }, value: { ...window.location, host: 'local.test', hostname: 'local.test' },
}); });
}); });
-1
View File
@@ -218,7 +218,6 @@ export const useSocialStore = create<SocialState>((set, get) => ({
res = await api.social.sendRequest(username); res = await api.social.sendRequest(username);
} else { } else {
const baseName = username.slice(0, atIndex); const baseName = username.slice(0, atIndex);
// Hostnames are case-insensitive; comparison RHS is canonical lowercase.
const domain = username.slice(atIndex + 1).toLowerCase(); const domain = username.slice(atIndex + 1).toLowerCase();
// Check if domain matches home instance // Check if domain matches home instance