update
This commit is contained in:
+7
-3
@@ -236,6 +236,8 @@ function initialStatus(scenario: MockScenario): Status {
|
||||
portable: false,
|
||||
sync: null,
|
||||
live: null,
|
||||
map_from_site: null,
|
||||
map_problem: null,
|
||||
};
|
||||
switch (scenario) {
|
||||
case "first-run":
|
||||
@@ -319,7 +321,7 @@ class MockBackend implements Backend {
|
||||
this.status = initialStatus(scenario);
|
||||
this.conflicts = scenario === "sync-conflicts" ? structuredClone(MOCK_CONFLICTS) : [];
|
||||
this.network = this.status.online;
|
||||
this.settings = { site_url: SITE_URL, mcp_url: MCP_URL, install_dir: DEFAULT_DIR };
|
||||
this.settings = { site_url: SITE_URL, mcp_url: MCP_URL, ai_url: "", install_dir: DEFAULT_DIR };
|
||||
if (this.status.installed) {
|
||||
// An installed mock PC has the basemap, Dark V2 and a stopped satellite download.
|
||||
for (const item of MOCK_MARKET) if (item.required) this.marketPresent.set(item.key, "installed");
|
||||
@@ -605,10 +607,12 @@ class MockBackend implements Backend {
|
||||
}
|
||||
|
||||
async setSettings(settings: Settings): Promise<Status> {
|
||||
for (const [label, url] of [
|
||||
// The AI address is optional: empty means the client stays offline.
|
||||
for (const [label, url] of ([
|
||||
["DHP URL", settings.site_url],
|
||||
["MCP URL", settings.mcp_url],
|
||||
] as const) {
|
||||
...(settings.ai_url.trim() ? [["AI URL", settings.ai_url] as const] : []),
|
||||
] as const)) {
|
||||
try {
|
||||
new URL(url);
|
||||
} catch {
|
||||
|
||||
Reference in New Issue
Block a user