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