Фикс: таймер загрузки контента (30ms debounce для editorContent), точки календаря — привязка к cal.currentMonth для корректного обновления при смене месяца
This commit is contained in:
@@ -316,6 +316,14 @@ Item {
|
||||
onDocIndexChanged: {
|
||||
pane.refreshHeader()
|
||||
pane.renderView()
|
||||
loadTimer.start()
|
||||
}
|
||||
|
||||
// Таймер для надёжной загрузки контента (обходит тайминг layout/QML)
|
||||
Timer {
|
||||
id: loadTimer
|
||||
interval: 30
|
||||
onTriggered: {
|
||||
if (pane.docIndex >= 0) {
|
||||
pane.editorContent = documentManager.contentAt(pane.docIndex)
|
||||
if (pane.editMode)
|
||||
@@ -324,6 +332,7 @@ Item {
|
||||
pane.editorContent = ""
|
||||
}
|
||||
}
|
||||
}
|
||||
onEditModeChanged: {
|
||||
if (!pane.editMode)
|
||||
pane.renderView()
|
||||
|
||||
@@ -90,6 +90,8 @@ Item {
|
||||
|
||||
// Проверяем, есть ли заметка за этот день
|
||||
readonly property bool hasNote: {
|
||||
// Явная зависимость от currentMonth — пересчитываем при смене месяца
|
||||
const _ = cal.currentMonth
|
||||
if (modelData <= 0 || !fileStore.ready) return false
|
||||
const ds = Qt.formatDate(new Date(cal.year, cal.month, modelData), "yyyy-MM-dd")
|
||||
return fileStore.fileExists(fileStore.vault + "/Журнал/" + ds + ".md")
|
||||
|
||||
Reference in New Issue
Block a user