Remove silly code

This commit is contained in:
Alexopus
2025-07-19 21:44:32 +02:00
parent 678d339431
commit b9ba22d33e
+3 -15
View File
@@ -177,7 +177,7 @@ class NotesSidebar {
// Save button: enabled only when there's an active note AND unsaved changes
this.saveBtn.disabled = !hasActiveNote || !hasUnsavedChanges;
// Rename and delete buttons: enabled only when there's an active note
this.renameBtn.disabled = !hasActiveNote;
this.deleteBtn.disabled = !hasActiveNote;
@@ -216,7 +216,7 @@ class NotesSidebar {
// Load notes after creating UI
await this.loadNotes();
// Ensure UI reflects the current state after initialization
this.renderTabs();
this.updateTextArea();
@@ -340,7 +340,7 @@ class NotesSidebar {
async selectNote(noteName) {
// Save current content before switching
if (this.activeNote && this.textArea) {
if (this.activeNote) {
this.store.setNoteContent(this.activeNote, this.textArea.value);
}
@@ -370,8 +370,6 @@ class NotesSidebar {
}
async saveActiveNote() {
if (!this.activeNote) return;
try {
const content = this.textArea.value;
const response = await fetch(`/notes_sidebar/note/${encodeURIComponent(this.activeNote)}`, {
@@ -395,8 +393,6 @@ class NotesSidebar {
}
async deleteActiveNote() {
if (!this.activeNote) return;
if (!confirm(`Are you sure you want to delete "${this.activeNote}"?`)) return;
try {
@@ -421,8 +417,6 @@ class NotesSidebar {
}
async renameActiveNote() {
if (!this.activeNote) return;
const newName = prompt('Enter new note name:', this.activeNote);
if (!newName || newName === this.activeNote) return;
@@ -512,12 +506,6 @@ class NotesSidebar {
}
onTextAreaChange() {
if (!this.activeNote) {
// Clear the textarea if someone types without an active note
this.textArea.value = '';
return;
}
const currentContent = this.textArea.value;
const savedContent = this.savedContent.get(this.activeNote) || '';