فهرست منبع

fix bug when note is open and user tries to open non existent note

Daniel Bohry 10 ماه پیش
والد
کامیت
81a1e42cb2
1فایلهای تغییر یافته به همراه2 افزوده شده و 5 حذف شده
  1. 2 5
      src/main/resources/static/script.js

+ 2 - 5
src/main/resources/static/script.js

@@ -393,15 +393,12 @@ function hideIdInput() {
 
 function loadNoteFromInput() {
     const noteIdInput = document.getElementById('noteIdInput');
-    if (!noteIdInput) {
-        console.error('Element with ID "noteIdInput" not found in loadNoteFromInput');
-        return;
-    }
+    if (!noteIdInput) return;
 
     const id = noteIdInput.value.trim();
     if (id) {
         hideIdInput();
-        loadNoteById(id);
+        window.location.href = `/${id}`;
     }
 }