fix: 뉴스 페이지네이션 리셋 버그 + 상세 링크 새 탭
- $effect에서 필터 변경 시에만 page 리셋 (페이지 클릭과 충돌 방지) - 상세 링크 → 새 탭으로 열기 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -105,11 +105,15 @@
|
|||||||
return `${days}일 전`;
|
return `${days}일 전`;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 필터 변경 시에만 1페이지 리셋
|
||||||
|
let prevFilter = '';
|
||||||
$effect(() => {
|
$effect(() => {
|
||||||
const _s = filterSource;
|
const key = `${filterSource}|${showUnreadOnly}`;
|
||||||
const _u = showUnreadOnly;
|
if (key !== prevFilter) {
|
||||||
|
prevFilter = key;
|
||||||
currentPage = 1;
|
currentPage = 1;
|
||||||
loadArticles();
|
loadArticles();
|
||||||
|
}
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
@@ -224,7 +228,8 @@
|
|||||||
<a
|
<a
|
||||||
href="/documents/{selectedArticle.id}"
|
href="/documents/{selectedArticle.id}"
|
||||||
class="text-xs text-[var(--text-dim)] hover:text-[var(--text)]"
|
class="text-xs text-[var(--text-dim)] hover:text-[var(--text)]"
|
||||||
>상세</a>
|
target="_blank"
|
||||||
|
>문서 상세 ↗</a>
|
||||||
<button
|
<button
|
||||||
onclick={() => selectedArticle = null}
|
onclick={() => selectedArticle = null}
|
||||||
class="text-xs text-[var(--text-dim)] hover:text-[var(--text)]"
|
class="text-xs text-[var(--text-dim)] hover:text-[var(--text)]"
|
||||||
|
|||||||
Reference in New Issue
Block a user