mirror of
https://github.com/vrtmrz/obsidian-livesync.git
synced 2026-09-09 12:17:07 +00:00
24 lines
1.0 KiB
TypeScript
24 lines
1.0 KiB
TypeScript
import { LOG_LEVEL_NOTICE } from "@vrtmrz/livesync-commonlib/compat/common/logger";
|
|
import type { LogFunction } from "@vrtmrz/livesync-commonlib/compat/services/lib/logUtils";
|
|
import { $msg } from "@/common/translation";
|
|
import { disableLegacyBulkChunkPreSend } from "@/common/compatibilitySettings";
|
|
import type { LegacyBulkSendSettings } from "./types";
|
|
|
|
/** Collaborators required to persist the obsolete bulk-send setting migration. */
|
|
export interface BulkSettingMigrationDependencies {
|
|
readonly settings: LegacyBulkSendSettings;
|
|
readonly log: LogFunction;
|
|
readonly saveSettings: () => Promise<void>;
|
|
}
|
|
|
|
/**
|
|
* Disable the removed automatic bulk chunk pre-send setting, retaining the
|
|
* former notice text and persistence boundary.
|
|
*/
|
|
export async function migrateBulkSendSetting(dependencies: BulkSettingMigrationDependencies): Promise<void> {
|
|
if (disableLegacyBulkChunkPreSend(dependencies.settings)) {
|
|
dependencies.log($msg("moduleMigration.logBulkSendCorrupted"), LOG_LEVEL_NOTICE);
|
|
await dependencies.saveSettings();
|
|
}
|
|
}
|