Block note creation in Quick Access and Trash views (#188)

This commit is contained in:
Yuri Karamian
2026-06-30 15:59:35 +02:00
parent 5345442de2
commit 24d1ba9f8f
+2 -1
View File
@@ -416,6 +416,7 @@
} }
export async function handleCreateNote() { export async function handleCreateNote() {
if ($viewMode === 'quickaccess' || $viewMode === 'trash') return;
if ($viewMode === 'daily') { if ($viewMode === 'daily') {
const today = new Date(); const today = new Date();
const date = `${today.getFullYear()}-${String(today.getMonth() + 1).padStart(2, '0')}-${String(today.getDate()).padStart(2, '0')}`; const date = `${today.getFullYear()}-${String(today.getMonth() + 1).padStart(2, '0')}-${String(today.getDate()).padStart(2, '0')}`;
@@ -453,7 +454,7 @@
const target = e.target as HTMLElement | null; const target = e.target as HTMLElement | null;
if (target?.closest('button, input, .note-item, .context-menu, .sort-menu, .batch-move-picker, .cal')) return; if (target?.closest('button, input, .note-item, .context-menu, .sort-menu, .batch-move-picker, .cal')) return;
e.stopPropagation(); e.stopPropagation();
if ($viewMode === 'tasks' || $viewMode === 'trash') return; if ($viewMode === 'tasks' || $viewMode === 'trash' || $viewMode === 'quickaccess') return;
handleCreateNote(); handleCreateNote();
} }