fix path
This commit is contained in:
@@ -1,3 +1,3 @@
|
|||||||
<!-- OAuth Comment System - Load globally for session management -->
|
<!-- OAuth Comment System - Load globally for session management -->
|
||||||
<script type="module" crossorigin src="/assets/comment-atproto-C3utAhPv.js"></script>
|
<script type="module" crossorigin src="/assets/comment-atproto-BxIEgp9a.js"></script>
|
||||||
<link rel="stylesheet" crossorigin href="/assets/comment-atproto-BH-72ESb.css">
|
<link rel="stylesheet" crossorigin href="/assets/comment-atproto-BH-72ESb.css">
|
@@ -1,3 +1,3 @@
|
|||||||
<!-- OAuth Comment System - Load globally for session management -->
|
<!-- OAuth Comment System - Load globally for session management -->
|
||||||
<script type="module" crossorigin src="/assets/comment-atproto-C3utAhPv.js"></script>
|
<script type="module" crossorigin src="/assets/comment-atproto-BxIEgp9a.js"></script>
|
||||||
<link rel="stylesheet" crossorigin href="/assets/comment-atproto-BH-72ESb.css">
|
<link rel="stylesheet" crossorigin href="/assets/comment-atproto-BH-72ESb.css">
|
@@ -302,13 +302,13 @@ function App() {
|
|||||||
const langData = await langResponse.json();
|
const langData = await langResponse.json();
|
||||||
const langRecords = langData.records || [];
|
const langRecords = langData.records || [];
|
||||||
|
|
||||||
// Filter by current page path if on post page
|
// Filter by current page rkey if on post page
|
||||||
const filteredLangRecords = appConfig.rkey
|
const filteredLangRecords = appConfig.rkey
|
||||||
? langRecords.filter(record => {
|
? langRecords.filter(record => {
|
||||||
// Compare path only, not full URL to support localhost vs production
|
// Compare rkey only (last part of path)
|
||||||
const recordPath = record.value.post?.url ? new URL(record.value.post.url).pathname :
|
const recordRkey = record.value.post?.url ? new URL(record.value.post.url).pathname.split('/').pop() : '';
|
||||||
record.value.url ? new URL(record.value.url).pathname : '';
|
const currentRkey = window.location.pathname.split('/').pop();
|
||||||
return recordPath === window.location.pathname;
|
return recordRkey === currentRkey;
|
||||||
})
|
})
|
||||||
: langRecords.slice(0, 3); // Top page: latest 3
|
: langRecords.slice(0, 3); // Top page: latest 3
|
||||||
|
|
||||||
@@ -321,13 +321,13 @@ function App() {
|
|||||||
const commentData = await commentResponse.json();
|
const commentData = await commentResponse.json();
|
||||||
const commentRecords = commentData.records || [];
|
const commentRecords = commentData.records || [];
|
||||||
|
|
||||||
// Filter by current page path if on post page
|
// Filter by current page rkey if on post page
|
||||||
const filteredCommentRecords = appConfig.rkey
|
const filteredCommentRecords = appConfig.rkey
|
||||||
? commentRecords.filter(record => {
|
? commentRecords.filter(record => {
|
||||||
// Compare path only, not full URL to support localhost vs production
|
// Compare rkey only (last part of path)
|
||||||
const recordPath = record.value.post?.url ? new URL(record.value.post.url).pathname :
|
const recordRkey = record.value.post?.url ? new URL(record.value.post.url).pathname.split('/').pop() : '';
|
||||||
record.value.url ? new URL(record.value.url).pathname : '';
|
const currentRkey = window.location.pathname.split('/').pop();
|
||||||
return recordPath === window.location.pathname;
|
return recordRkey === currentRkey;
|
||||||
})
|
})
|
||||||
: commentRecords.slice(0, 3); // Top page: latest 3
|
: commentRecords.slice(0, 3); // Top page: latest 3
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user