fix(note): address code review findings
- restoreVersion: ผ่าน validateAnnotationData ก่อน insert สาขา "ต้นทางถูกลบ" ให้สมมาตรกับสาขา update (invariant #8) - PDFViewer: track timer ล้าง exportError ใน ref — กัน export พัง สองรอบติดกันแล้ว timer รอบแรกเคลียร์ error รอบหลังก่อนเวลา - useHistory: เพิ่ม onError — undo/redo ล้มแสดง toast ผ่าน showActionError แทนหายเงียบ ๆ - DebugConsole: ไม่โหลด Eruda จาก CDN ใน production build (ระบบ intranet + token อยู่ใน origin เดียวกัน) - NoteHome: ตัด dead state session ที่ render ไม่ได้อ่าน - note-auth: export SSO_REQUIRED_BANNER ให้หน้า gate ใช้ตรง ๆ ถอด non-null assertion ใน AnnotateView + bookmarkDepthOf Verify: npx tsc --noEmit ผ่าน · vitest 317/317 ผ่าน Co-Authored-By: Claude Code <noreply@anthropic.com>
This commit is contained in:
parent
d37bc2a3f0
commit
2d466efd4f
7 changed files with 50 additions and 17 deletions
|
|
@ -9,6 +9,9 @@ import { useEffect } from "react";
|
|||
* app/note/annotate/[id]/page.tsx */
|
||||
export default function DebugConsole() {
|
||||
useEffect(() => {
|
||||
// production build ไม่โหลด CDN เด็ดขาด (ระบบ intranet + token อยู่ใน origin
|
||||
// เดียวกับ script นี้) — ใช้ได้เฉพาะ dev server ที่เครื่องทดสอบเปิดให้ LAN
|
||||
if (process.env.NODE_ENV === "production") return;
|
||||
if (!new URLSearchParams(window.location.search).has("debug")) return;
|
||||
// React strict mode รัน effect สองรอบ — กัน append script ซ้ำ
|
||||
if (document.getElementById("eruda-loader")) return;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue