+5
-6
src/lib/services/atproto/posts.ts
+5
-6
src/lib/services/atproto/posts.ts
···
163
163
const publicationUri = value.publication;
164
164
const publication = publicationsMap.get(publicationUri);
165
165
166
-
// Determine URL based on priority: publication base_path → Leaflet /lish format
166
+
// Determine URL based on priority: publication base_path → Leaflet /p/[DID]/[rkey] format
167
167
let url: string;
168
-
const publicationRkey = publicationUri ? publicationUri.split('/').pop() : '';
168
+
const publicationRkey = publicationUri ? publicationUri.split('/').pop() : undefined;
169
169
170
170
if (publication?.basePath) {
171
171
// Ensure basePath is a complete URL
···
173
173
? publication.basePath
174
174
: `https://${publication.basePath}`;
175
175
url = `${basePath}/${rkey}`;
176
-
} else if (publicationRkey) {
177
-
url = `https://leaflet.pub/lish/${PUBLIC_ATPROTO_DID}/${publicationRkey}/${rkey}`;
178
176
} else {
179
-
url = `https://leaflet.pub/${PUBLIC_ATPROTO_DID}/${rkey}`;
177
+
// Fallback format: https://leaflet.pub/p/[DID]/[rkey]
178
+
url = `https://leaflet.pub/p/${PUBLIC_ATPROTO_DID}/${rkey}`;
180
179
}
181
180
182
181
posts.push({
···
187
186
description: value.description,
188
187
rkey,
189
188
publicationName: publication?.name,
190
-
publicationRkey: publicationRkey || undefined
189
+
publicationRkey
191
190
});
192
191
}
193
192
} catch (error) {