- No longer batch-saving ignores editor inputs.
- The file-watching and serialisation processes have been changed to the one which is similar to previous implementations.
- We can configure the settings (Especially about text-boxes) even if we have configured the device name.
Improved:
- We can configure the delay of batch-saving.
  - Default: 5 seconds, the same as the previous hard-coded value. (Note: also, the previous behaviour was not correct).
- Also, we can configure the limit of delaying batch-saving.
- The performance of showing status indicators has been improved.
This commit is contained in:
vorotamoroz
2024-06-14 12:35:56 +01:00
parent 16c6c52128
commit 29ed4d2b95
7 changed files with 308 additions and 136 deletions

View File

@@ -644,6 +644,7 @@ export class ObsidianLiveSyncSettingTab extends PluginSettingTab {
const keys = Object.keys(newConf) as (keyof ObsidianLiveSyncSettings)[];
let hasLoaded = false;
for (const k of keys) {
if (k === "deviceAndVaultName") continue;
if (isObjectDifferent(newConf[k], this.initialSettings?.[k])) {
// Something has changed
if (this.isDirty(k as AllSettingItemKey)) {
@@ -1739,6 +1740,24 @@ However, your report is needed to stabilise this. I appreciate you for your grea
new Setting(containerSyncSettingEl)
.setClass("wizardHidden")
.autoWireToggle("batchSave")
new Setting(containerSyncSettingEl)
.setClass("wizardHidden")
.autoWireNumeric("batchSaveMinimumDelay",
{
acceptZero: true,
onUpdate: visibleOnly(() => this.isConfiguredAs("batchSave", true))
}
)
new Setting(containerSyncSettingEl)
.setClass("wizardHidden")
.autoWireNumeric("batchSaveMaximumDelay",
{
acceptZero: true,
onUpdate: visibleOnly(() => this.isConfiguredAs("batchSave", true))
}
)
new Setting(containerSyncSettingEl)
.setClass("wizardHidden")

View File

@@ -67,11 +67,11 @@ export const SettingInformation: Partial<Record<keyof AllSettings, Configuration
},
"lessInformationInLog": {
"name": "Show only notifications",
"desc": "Prevent logging and show only notification"
"desc": "Prevent logging and show only notification. Please disable when you report the logs"
},
"showVerboseLog": {
"name": "Verbose Log",
"desc": "Show verbose log"
"desc": "Show verbose log. Please enable when you report the logs"
},
"hashCacheMaxCount": {
"name": "Memory cache size (by total items)"
@@ -312,6 +312,14 @@ export const SettingInformation: Partial<Record<keyof AllSettings, Configuration
processSmallFilesInUIThread: {
name: "Process small files in the foreground",
desc: "If enabled, the file under 1kb will be processed in the UI thread."
},
batchSaveMinimumDelay: {
name: "Minimum delay for batch database updating",
desc: "Seconds. Saving to the local database will be delayed until this value after we stop typing or saving."
},
batchSaveMaximumDelay: {
name: "Maximum delay for batch database updating",
desc: "Saving will be performed forcefully after this number of seconds."
}
}
function translateInfo(infoSrc: ConfigurationItem | undefined | false) {