Simplify sync service
This commit is contained in:
parent
04db2b2abb
commit
e8e986439b
1 changed files with 138 additions and 384 deletions
|
|
@ -434,6 +434,42 @@ export class SyncSettingsTab extends PluginSettingTab {
|
|||
|
||||
containerEl.createEl("h3", { text: "Advanced" });
|
||||
|
||||
new Setting(containerEl)
|
||||
.setName("Request timeout (ms)")
|
||||
.setDesc(
|
||||
"The maximum time to wait for a server request, in milliseconds."
|
||||
)
|
||||
.addText((input) =>
|
||||
input
|
||||
.setValue(
|
||||
this.syncClient
|
||||
.getSettings()
|
||||
.requestTimeoutMs.toString()
|
||||
)
|
||||
.onChange(async (value) => {
|
||||
if (value === "") {
|
||||
return;
|
||||
}
|
||||
let parsedValue = Number(value);
|
||||
if (
|
||||
!Number.isSafeInteger(parsedValue) ||
|
||||
parsedValue <= 0
|
||||
) {
|
||||
parsedValue =
|
||||
this.syncClient.getSettings().requestTimeoutMs;
|
||||
}
|
||||
|
||||
if (value !== parsedValue.toString()) {
|
||||
input.setValue(parsedValue.toString());
|
||||
}
|
||||
|
||||
return this.syncClient.setSetting(
|
||||
"requestTimeoutMs",
|
||||
parsedValue
|
||||
);
|
||||
})
|
||||
);
|
||||
|
||||
new Setting(containerEl)
|
||||
.setName("Network retry interval (ms)")
|
||||
.setDesc(
|
||||
|
|
|
|||
Loading…
Reference in a new issue