Browse Source

Set kind 3 (follow lists) default limit to 0

- Change default follow list limit from 1 to 0
- Add explicit check to skip fetching when limit is 0
- This prevents unnecessary profile fetching on initial load
- When users change limit to >0, then all follow list profiles are fetched

This provides the optimal default behavior:
- Initial load only fetches profiles from event authors
- Users can opt-in to social graph by increasing follow list limit

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
master
limina1 9 months ago
parent
commit
24b111396e
  1. 4
      src/lib/stores/visualizationConfig.ts
  2. 8
      src/routes/visualize/+page.svelte

4
src/lib/stores/visualizationConfig.ts

@ -27,8 +27,8 @@ export interface VisualizationConfig { @@ -27,8 +27,8 @@ export interface VisualizationConfig {
// Default configurations for common event kinds
const DEFAULT_EVENT_CONFIGS: EventKindConfig[] = [
{ kind: 0, limit: 50 }, // Metadata events (profiles) - controls how many profiles to fetch
{ kind: 3, limit: 1, depth: 0 }, // Follow lists - limit 1 = just user's, higher = user's + from follows
{ kind: 0, limit: 50 }, // Metadata events (profiles) - controls how many profiles to display
{ kind: 3, limit: 0, depth: 0 }, // Follow lists - limit 0 = don't fetch, >0 = fetch follow lists
{ kind: 30040, limit: 20, nestedLevels: 1 },
{ kind: 30041, limit: 20 },
{ kind: 30818, limit: 20 },

8
src/routes/visualize/+page.svelte

@ -83,7 +83,13 @@ @@ -83,7 +83,13 @@
const allFollowEvents: NDKEvent[] = [];
const processedPubkeys = new Set<string>();
debug(`Fetching kind 3 follow lists with depth ${depth}, addFollowLists: ${config.addFollowLists}`);
debug(`Fetching kind 3 follow lists with limit ${config.limit}, depth ${depth}`);
// If limit is 0, don't fetch any follow lists
if (config.limit === 0) {
debug("Follow list limit is 0, skipping fetch");
return [];
}
// Get the current user's pubkey
const currentUserPubkey = get(activePubkey);

Loading…
Cancel
Save