v1.0.4: migrate legacy OGD proxy URL to self-hosted Worker on load

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
ml2310 2026-05-24 19:35:03 +08:00
parent 03243972b1
commit 6dd16def1a
4 changed files with 13 additions and 2 deletions

View file

@ -1164,6 +1164,10 @@ var NeoGDSync = class extends import_obsidian5.Plugin {
this.pendingOps = (_b = saved == null ? void 0 : saved.pendingOps) != null ? _b : {};
this.conflicts = (_c = saved == null ? void 0 : saved.conflicts) != null ? _c : [];
if (this.snapshot) this.snapshot.setRaw(saved == null ? void 0 : saved.snapshot);
if (this.settings.authProxyUrl === "https://ogd.richardxiong.com/api/access") {
this.settings.authProxyUrl = DEFAULT_SETTINGS.authProxyUrl;
await this.saveSettings();
}
}
async saveSettings() {
await this.saveData({

View file

@ -1,7 +1,7 @@
{
"id": "neogdsync",
"name": "NeoGDSync",
"version": "1.0.3",
"version": "1.0.4",
"minAppVersion": "1.6.0",
"description": "Lightweight Google Drive sync with path-based index, conflict detection, and smart/push/pull modes.",
"author": "martinlegend",

View file

@ -292,6 +292,12 @@ export default class NeoGDSync extends Plugin {
this.pendingOps = saved?.pendingOps ?? {};
this.conflicts = saved?.conflicts ?? [];
if (this.snapshot) this.snapshot.setRaw(saved?.snapshot);
// Migrate: replace legacy third-party proxy URL with self-hosted Worker
if (this.settings.authProxyUrl === 'https://ogd.richardxiong.com/api/access') {
this.settings.authProxyUrl = DEFAULT_SETTINGS.authProxyUrl;
await this.saveSettings();
}
}
async saveSettings() {

View file

@ -14,5 +14,6 @@
"1.0.0": "1.6.0",
"1.0.1": "1.6.0",
"1.0.2": "1.6.0",
"1.0.3": "1.6.0"
"1.0.3": "1.6.0",
"1.0.4": "1.6.0"
}