Przeglądaj źródła

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

Daniel Bohry 1 miesiąc temu
rodzic
commit
81a1e42cb2
1 zmienionych plików z 2 dodań i 5 usunięć
  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}`;
     }
 }