mirror of
https://github.com/vrtmrz/obsidian-livesync.git
synced 2025-12-13 17:55:56 +00:00
run prettier and update lib
This commit is contained in:
2
src/lib
2
src/lib
Submodule src/lib updated: 90ace6de16...d94133d964
@@ -93,9 +93,12 @@ export class ModuleCheckRemoteSize extends AbstractModule implements ICoreModule
|
|||||||
LOG_LEVEL_INFO
|
LOG_LEVEL_INFO
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
this._log($msg("moduleCheckRemoteSize.logCurrentStorageSize", {
|
this._log(
|
||||||
measuredSize: sizeToHumanReadable(estimatedSize),
|
$msg("moduleCheckRemoteSize.logCurrentStorageSize", {
|
||||||
}), LOG_LEVEL_INFO);
|
measuredSize: sizeToHumanReadable(estimatedSize),
|
||||||
|
}),
|
||||||
|
LOG_LEVEL_INFO
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ import { $msg } from "src/lib/src/common/i18n.ts";
|
|||||||
export class ModuleMigration extends AbstractModule implements ICoreModule {
|
export class ModuleMigration extends AbstractModule implements ICoreModule {
|
||||||
async migrateDisableBulkSend() {
|
async migrateDisableBulkSend() {
|
||||||
if (this.settings.sendChunksBulk) {
|
if (this.settings.sendChunksBulk) {
|
||||||
this._log($msg('moduleMigration.logBulkSendCorrupted'), LOG_LEVEL_NOTICE);
|
this._log($msg("moduleMigration.logBulkSendCorrupted"), LOG_LEVEL_NOTICE);
|
||||||
this.settings.sendChunksBulk = false;
|
this.settings.sendChunksBulk = false;
|
||||||
this.settings.sendChunksBulkMaxSize = 1;
|
this.settings.sendChunksBulkMaxSize = 1;
|
||||||
await this.saveSettings();
|
await this.saveSettings();
|
||||||
@@ -24,10 +24,13 @@ export class ModuleMigration extends AbstractModule implements ICoreModule {
|
|||||||
const current = SETTING_VERSION_SUPPORT_CASE_INSENSITIVE;
|
const current = SETTING_VERSION_SUPPORT_CASE_INSENSITIVE;
|
||||||
// Check each migrations(old -> current)
|
// Check each migrations(old -> current)
|
||||||
if (!(await this.migrateToCaseInsensitive(old, current))) {
|
if (!(await this.migrateToCaseInsensitive(old, current))) {
|
||||||
this._log($msg('moduleMigration.logMigrationFailed', {
|
this._log(
|
||||||
old: old.toString(),
|
$msg("moduleMigration.logMigrationFailed", {
|
||||||
current: current.toString()
|
old: old.toString(),
|
||||||
}), LOG_LEVEL_NOTICE);
|
current: current.toString(),
|
||||||
|
}),
|
||||||
|
LOG_LEVEL_NOTICE
|
||||||
|
);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -67,10 +70,10 @@ export class ModuleMigration extends AbstractModule implements ICoreModule {
|
|||||||
remoteChecked = true;
|
remoteChecked = true;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
this._log($msg('moduleMigration.logFetchRemoteTweakFailed'), LOG_LEVEL_INFO);
|
this._log($msg("moduleMigration.logFetchRemoteTweakFailed"), LOG_LEVEL_INFO);
|
||||||
}
|
}
|
||||||
} catch (ex) {
|
} catch (ex) {
|
||||||
this._log($msg('moduleMigration.logRemoteTweakUnavailable'), LOG_LEVEL_INFO);
|
this._log($msg("moduleMigration.logRemoteTweakUnavailable"), LOG_LEVEL_INFO);
|
||||||
this._log(ex, LOG_LEVEL_VERBOSE);
|
this._log(ex, LOG_LEVEL_VERBOSE);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -81,18 +84,21 @@ export class ModuleMigration extends AbstractModule implements ICoreModule {
|
|||||||
this.settings.handleFilenameCaseSensitive = true;
|
this.settings.handleFilenameCaseSensitive = true;
|
||||||
this.settings.doNotUseFixedRevisionForChunks = true;
|
this.settings.doNotUseFixedRevisionForChunks = true;
|
||||||
this.settings.settingVersion = SETTING_VERSION_SUPPORT_CASE_INSENSITIVE;
|
this.settings.settingVersion = SETTING_VERSION_SUPPORT_CASE_INSENSITIVE;
|
||||||
this._log($msg('moduleMigration.logMigratedSameBehaviour', {
|
this._log(
|
||||||
current: current.toString()
|
$msg("moduleMigration.logMigratedSameBehaviour", {
|
||||||
}), LOG_LEVEL_INFO);
|
current: current.toString(),
|
||||||
|
}),
|
||||||
|
LOG_LEVEL_INFO
|
||||||
|
);
|
||||||
await this.saveSettings();
|
await this.saveSettings();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
const message = $msg('moduleMigration.msgFetchRemoteAgain');
|
const message = $msg("moduleMigration.msgFetchRemoteAgain");
|
||||||
const OPTION_FETCH = $msg('moduleMigration.optionYesFetchAgain');
|
const OPTION_FETCH = $msg("moduleMigration.optionYesFetchAgain");
|
||||||
const DISMISS = $msg('moduleMigration.optionNoAskAgain');
|
const DISMISS = $msg("moduleMigration.optionNoAskAgain");
|
||||||
const options = [OPTION_FETCH, DISMISS];
|
const options = [OPTION_FETCH, DISMISS];
|
||||||
const ret = await this.core.confirm.confirmWithMessage(
|
const ret = await this.core.confirm.confirmWithMessage(
|
||||||
$msg('moduleMigration.titleCaseSensitivity'),
|
$msg("moduleMigration.titleCaseSensitivity"),
|
||||||
message,
|
message,
|
||||||
options,
|
options,
|
||||||
DISMISS,
|
DISMISS,
|
||||||
@@ -107,7 +113,7 @@ export class ModuleMigration extends AbstractModule implements ICoreModule {
|
|||||||
await this.core.rebuilder.scheduleFetch();
|
await this.core.rebuilder.scheduleFetch();
|
||||||
return;
|
return;
|
||||||
} catch (ex) {
|
} catch (ex) {
|
||||||
this._log($msg('moduleMigration.logRedflag2CreationFail'), LOG_LEVEL_VERBOSE);
|
this._log($msg("moduleMigration.logRedflag2CreationFail"), LOG_LEVEL_VERBOSE);
|
||||||
this._log(ex, LOG_LEVEL_VERBOSE);
|
this._log(ex, LOG_LEVEL_VERBOSE);
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
@@ -116,19 +122,25 @@ export class ModuleMigration extends AbstractModule implements ICoreModule {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const ENABLE_BOTH = $msg('moduleMigration.optionEnableBoth');
|
const ENABLE_BOTH = $msg("moduleMigration.optionEnableBoth");
|
||||||
const ENABLE_FILENAME_CASE_INSENSITIVE = $msg('moduleMigration.optionEnableFilenameCaseInsensitive');
|
const ENABLE_FILENAME_CASE_INSENSITIVE = $msg("moduleMigration.optionEnableFilenameCaseInsensitive");
|
||||||
const ENABLE_FIXED_REVISION_FOR_CHUNKS = $msg('moduleMigration.optionEnableFixedRevisionForChunks');
|
const ENABLE_FIXED_REVISION_FOR_CHUNKS = $msg("moduleMigration.optionEnableFixedRevisionForChunks");
|
||||||
const ADJUST_TO_REMOTE = $msg('moduleMigration.optionAdjustRemote');
|
const ADJUST_TO_REMOTE = $msg("moduleMigration.optionAdjustRemote");
|
||||||
const KEEP = $msg('moduleMigration.optionKeepPreviousBehaviour');
|
const KEEP = $msg("moduleMigration.optionKeepPreviousBehaviour");
|
||||||
const DISMISS = $msg('moduleMigration.optionDecideLater');
|
const DISMISS = $msg("moduleMigration.optionDecideLater");
|
||||||
const message = $msg('moduleMigration.msgSinceV02321');
|
const message = $msg("moduleMigration.msgSinceV02321");
|
||||||
const options = [ENABLE_BOTH, ENABLE_FILENAME_CASE_INSENSITIVE, ENABLE_FIXED_REVISION_FOR_CHUNKS];
|
const options = [ENABLE_BOTH, ENABLE_FILENAME_CASE_INSENSITIVE, ENABLE_FIXED_REVISION_FOR_CHUNKS];
|
||||||
if (remoteChecked) {
|
if (remoteChecked) {
|
||||||
options.push(ADJUST_TO_REMOTE);
|
options.push(ADJUST_TO_REMOTE);
|
||||||
}
|
}
|
||||||
options.push(KEEP, DISMISS);
|
options.push(KEEP, DISMISS);
|
||||||
const ret = await this.core.confirm.confirmWithMessage($msg('moduleMigration.titleCaseSensitivity'), message, options, DISMISS, 40);
|
const ret = await this.core.confirm.confirmWithMessage(
|
||||||
|
$msg("moduleMigration.titleCaseSensitivity"),
|
||||||
|
message,
|
||||||
|
options,
|
||||||
|
DISMISS,
|
||||||
|
40
|
||||||
|
);
|
||||||
console.dir(ret);
|
console.dir(ret);
|
||||||
switch (ret) {
|
switch (ret) {
|
||||||
case ENABLE_BOTH:
|
case ENABLE_BOTH:
|
||||||
@@ -160,14 +172,14 @@ export class ModuleMigration extends AbstractModule implements ICoreModule {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async initialMessage() {
|
async initialMessage() {
|
||||||
const message = $msg('moduleMigration.msgInitialSetup', {
|
const message = $msg("moduleMigration.msgInitialSetup", {
|
||||||
URI_DOC: $msg('moduleMigration.docUri'),
|
URI_DOC: $msg("moduleMigration.docUri"),
|
||||||
});
|
});
|
||||||
const USE_SETUP = $msg('moduleMigration.optionHaveSetupUri');
|
const USE_SETUP = $msg("moduleMigration.optionHaveSetupUri");
|
||||||
const NEXT = $msg('moduleMigration.optionNoSetupUri');
|
const NEXT = $msg("moduleMigration.optionNoSetupUri");
|
||||||
|
|
||||||
const ret = await this.core.confirm.askSelectStringDialogue(message, [USE_SETUP, NEXT], {
|
const ret = await this.core.confirm.askSelectStringDialogue(message, [USE_SETUP, NEXT], {
|
||||||
title: $msg('moduleMigration.titleWelcome'),
|
title: $msg("moduleMigration.titleWelcome"),
|
||||||
defaultAction: USE_SETUP,
|
defaultAction: USE_SETUP,
|
||||||
});
|
});
|
||||||
if (ret === USE_SETUP) {
|
if (ret === USE_SETUP) {
|
||||||
@@ -180,13 +192,13 @@ export class ModuleMigration extends AbstractModule implements ICoreModule {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async askAgainForSetupURI() {
|
async askAgainForSetupURI() {
|
||||||
const message = $msg('moduleMigration.msgRecommendSetupUri', { URI_DOC: $msg('moduleMigration.docUri') });
|
const message = $msg("moduleMigration.msgRecommendSetupUri", { URI_DOC: $msg("moduleMigration.docUri") });
|
||||||
const USE_MINIMAL = $msg('moduleMigration.optionSetupWizard');
|
const USE_MINIMAL = $msg("moduleMigration.optionSetupWizard");
|
||||||
const USE_SETUP = $msg('moduleMigration.optionManualSetup');
|
const USE_SETUP = $msg("moduleMigration.optionManualSetup");
|
||||||
const NEXT = $msg('moduleMigration.optionRemindNextLaunch');
|
const NEXT = $msg("moduleMigration.optionRemindNextLaunch");
|
||||||
|
|
||||||
const ret = await this.core.confirm.askSelectStringDialogue(message, [USE_MINIMAL, USE_SETUP, NEXT], {
|
const ret = await this.core.confirm.askSelectStringDialogue(message, [USE_MINIMAL, USE_SETUP, NEXT], {
|
||||||
title: $msg('moduleMigration.titleRecommendSetupUri'),
|
title: $msg("moduleMigration.titleRecommendSetupUri"),
|
||||||
defaultAction: USE_MINIMAL,
|
defaultAction: USE_MINIMAL,
|
||||||
});
|
});
|
||||||
if (ret === USE_MINIMAL) {
|
if (ret === USE_MINIMAL) {
|
||||||
@@ -204,7 +216,7 @@ export class ModuleMigration extends AbstractModule implements ICoreModule {
|
|||||||
|
|
||||||
async $everyOnFirstInitialize(): Promise<boolean> {
|
async $everyOnFirstInitialize(): Promise<boolean> {
|
||||||
if (!this.localDatabase.isReady) {
|
if (!this.localDatabase.isReady) {
|
||||||
this._log($msg('moduleMigration.logLocalDatabaseNotReady'), LOG_LEVEL_NOTICE);
|
this._log($msg("moduleMigration.logLocalDatabaseNotReady"), LOG_LEVEL_NOTICE);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (this.settings.isConfigured) {
|
if (this.settings.isConfigured) {
|
||||||
@@ -214,7 +226,7 @@ export class ModuleMigration extends AbstractModule implements ICoreModule {
|
|||||||
if (!this.settings.isConfigured) {
|
if (!this.settings.isConfigured) {
|
||||||
// Case sensitivity
|
// Case sensitivity
|
||||||
if (!(await this.initialMessage()) || !(await this.askAgainForSetupURI())) {
|
if (!(await this.initialMessage()) || !(await this.askAgainForSetupURI())) {
|
||||||
this._log($msg('moduleMigration.logSetupCancelled'), LOG_LEVEL_NOTICE);
|
this._log($msg("moduleMigration.logSetupCancelled"), LOG_LEVEL_NOTICE);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -218,13 +218,10 @@ export class LiveSyncSetting extends Setting {
|
|||||||
await this.commitValue(value);
|
await this.commitValue(value);
|
||||||
} else {
|
} else {
|
||||||
this.setTooltip(
|
this.setTooltip(
|
||||||
$msg(
|
$msg("liveSyncSetting.valueShouldBeInRange", {
|
||||||
"liveSyncSetting.valueShouldBeInRange",
|
min: opt.clampMin?.toString() || "~",
|
||||||
{
|
max: opt.clampMax?.toString() || "~",
|
||||||
min: opt.clampMin?.toString() || "~",
|
})
|
||||||
max: opt.clampMax?.toString() || "~",
|
|
||||||
}
|
|
||||||
)
|
|
||||||
);
|
);
|
||||||
text.inputEl.toggleClass("sls-item-invalid-value", true);
|
text.inputEl.toggleClass("sls-item-invalid-value", true);
|
||||||
lastError = true;
|
lastError = true;
|
||||||
@@ -373,7 +370,9 @@ export class LiveSyncSetting extends Setting {
|
|||||||
if (this.holdValue && this.selfKey) {
|
if (this.holdValue && this.selfKey) {
|
||||||
const isDirty = LiveSyncSetting.env.isDirty(this.selfKey);
|
const isDirty = LiveSyncSetting.env.isDirty(this.selfKey);
|
||||||
const alt = isDirty
|
const alt = isDirty
|
||||||
? $msg("liveSyncSetting.originalValue", { value: String(LiveSyncSetting.env.initialSettings?.[this.selfKey] ?? "") })
|
? $msg("liveSyncSetting.originalValue", {
|
||||||
|
value: String(LiveSyncSetting.env.initialSettings?.[this.selfKey] ?? ""),
|
||||||
|
})
|
||||||
: "";
|
: "";
|
||||||
this.controlEl.toggleClass("sls-item-dirty", isDirty);
|
this.controlEl.toggleClass("sls-item-dirty", isDirty);
|
||||||
if (!this.hasPassword) {
|
if (!this.hasPassword) {
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -24,7 +24,7 @@ export class ModuleLiveSyncMain extends AbstractModule implements ICoreModule {
|
|||||||
const ANSWER_RESUME = $msg("moduleLiveSyncMain.optionResumeAndRestart");
|
const ANSWER_RESUME = $msg("moduleLiveSyncMain.optionResumeAndRestart");
|
||||||
const message = $msg("moduleLiveSyncMain.msgScramEnabled", {
|
const message = $msg("moduleLiveSyncMain.msgScramEnabled", {
|
||||||
fileWatchingStatus: this.settings.suspendFileWatching ? "suspended" : "active",
|
fileWatchingStatus: this.settings.suspendFileWatching ? "suspended" : "active",
|
||||||
parseReplicationStatus: this.settings.suspendParseReplicationResult ? "suspended" : "active"
|
parseReplicationStatus: this.settings.suspendParseReplicationResult ? "suspended" : "active",
|
||||||
});
|
});
|
||||||
if (
|
if (
|
||||||
(await this.core.confirm.askSelectStringDialogue(message, [ANSWER_KEEP, ANSWER_RESUME], {
|
(await this.core.confirm.askSelectStringDialogue(message, [ANSWER_KEEP, ANSWER_RESUME], {
|
||||||
|
|||||||
Reference in New Issue
Block a user