Skip to content

Commit 172c322

Browse files
committed
Preserve manual switch selections
1 parent 4331950 commit 172c322

3 files changed

Lines changed: 9 additions & 2 deletions

File tree

tests/strategy_switch_worker_validation.mjs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,15 @@
11
import assert from "node:assert/strict";
2+
import { readFileSync } from "node:fs";
3+
import { fileURLToPath } from "node:url";
4+
import { dirname, resolve } from "node:path";
25

36
import { __test } from "../web/strategy-switch-console/worker.js";
47

8+
const root = resolve(dirname(fileURLToPath(import.meta.url)), "..");
9+
const indexHtml = readFileSync(resolve(root, "web/strategy-switch-console/index.html"), "utf8");
10+
const renderPlatformsBody = indexHtml.match(/function renderPlatforms\(\) \{([\s\S]*?)\n \}/)?.[1] || "";
11+
assert.ok(!renderPlatformsBody.includes("syncStrategyForAccount("));
12+
513
const strategyProfiles = __test.normalizeStrategyProfilesPayload(
614
[
715
{

web/strategy-switch-console/index.html

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1059,7 +1059,6 @@ <h2 data-i18n="summary">切换摘要</h2>
10591059
strip.innerHTML = "";
10601060
for (const platform of Object.keys(platformMeta)) {
10611061
ensureAccountSelection(platform);
1062-
syncStrategyForAccount(platform);
10631062
const meta = platformMeta[platform];
10641063
const form = state.forms[platform];
10651064
const account = selectedAccount(platform);

web/strategy-switch-console/page_asset.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)