mirror of
https://github.com/vrtmrz/obsidian-livesync.git
synced 2026-05-14 19:41:16 +00:00
Fixed: No longer credentials are broken during object storage configuration (related: #852).
Co-authored-by: Copilot <copilot@github.com>
This commit is contained in:
17
src/modules/features/SettingDialogue/remoteConfigBuffer.ts
Normal file
17
src/modules/features/SettingDialogue/remoteConfigBuffer.ts
Normal file
@@ -0,0 +1,17 @@
|
||||
import { pickBucketSyncSettings, pickCouchDBSyncSettings, pickP2PSyncSettings } from "@lib/common/utils.ts";
|
||||
import type { ObsidianLiveSyncSettings } from "@lib/common/types.ts";
|
||||
|
||||
// Keep the setting dialogue buffer aligned with the current core settings before persisting other dirty keys.
|
||||
// This also clears stale dirty values left from editing a different remote type before switching active remotes.
|
||||
export function syncActivatedRemoteSettings(
|
||||
target: Partial<ObsidianLiveSyncSettings>,
|
||||
source: ObsidianLiveSyncSettings
|
||||
): void {
|
||||
Object.assign(target, {
|
||||
remoteType: source.remoteType,
|
||||
activeConfigurationId: source.activeConfigurationId,
|
||||
...pickBucketSyncSettings(source),
|
||||
...pickCouchDBSyncSettings(source),
|
||||
...pickP2PSyncSettings(source),
|
||||
});
|
||||
}
|
||||
Reference in New Issue
Block a user