tangled
alpha
login
or
join now
flo-bit.dev
/
blento
21
fork
atom
your personal website on atproto - mirror
blento.app
21
fork
atom
overview
issues
pulls
pipelines
fix invalid handle
Florian
1 month ago
02917554
cf7ab30f
+14
-2
2 changed files
expand all
collapse all
unified
split
src
lib
atproto
methods.ts
cards
SpecialCards
UpdatedBlentos
index.ts
+5
-1
src/lib/atproto/methods.ts
···
93
params: { actor: data.did }
94
});
95
96
-
if (!response.ok) return;
0
0
0
0
97
98
return response.data;
99
}
···
93
params: { actor: data.did }
94
});
95
96
+
if (!response.ok || response.data.handle === 'handle.invalid') {
97
+
// fall back to describe repo
98
+
const repo = await describeRepo({ did: data.did, client: data.client });
99
+
return { handle: repo?.handle ?? 'handle.invalid', did: data.did };
100
+
}
101
102
return response.data;
103
}
+9
-1
src/lib/cards/SpecialCards/UpdatedBlentos/index.ts
···
30
for (const did of Array.from(uniqueDids)) {
31
const profile = getDetailedProfile({ did });
32
profiles.push(profile);
33
-
if (profiles.length > 20) break;
0
0
0
0
0
0
0
0
34
}
35
36
const result = [...(await Promise.all(profiles)), ...existingUsersArray];
···
30
for (const did of Array.from(uniqueDids)) {
31
const profile = getDetailedProfile({ did });
32
profiles.push(profile);
33
+
if (profiles.length > 30) break;
34
+
}
35
+
36
+
for (let i = existingUsersArray.length - 1; i >= 0; i--) {
37
+
// if handle is handle.invalid, remove from existing users and add to profiles to refresh
38
+
if (existingUsersArray[i].handle === 'handle.invalid') {
39
+
const removed = existingUsersArray.splice(i, 1)[0];
40
+
profiles.push(getDetailedProfile({ did: removed.did }));
41
+
}
42
}
43
44
const result = [...(await Promise.all(profiles)), ...existingUsersArray];