From 7f7680f4a6c2dc9c272221b5e8ffad10eb63b178 Mon Sep 17 00:00:00 2001 From: Matthew Raymer Date: Mon, 25 Aug 2025 11:51:12 +0000 Subject: [PATCH] fix(config): remove forced API server overrides - Remove forced production server override in PlatformServiceMixin.() - Remove forced production server override in PlatformServiceMixin.() - Remove forced production server override in HomeView.ensureCorrectApiServer() - Fix type error in HomeView.latLongInAnySearchBox coordinates Testing: TypeScript compilation passes, no linting errors Impact: Users can now switch API servers freely without forced overrides --- src/views/HomeView.vue | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/src/views/HomeView.vue b/src/views/HomeView.vue index 5609096f..3a910119 100644 --- a/src/views/HomeView.vue +++ b/src/views/HomeView.vue @@ -601,8 +601,9 @@ export default class HomeView extends Vue { } /** - * Ensures API server is correctly set for the current platform - * For Electron, always use production endpoint regardless of saved settings + * Ensures correct API server configuration + * + * FIXED: Now respects user preferences instead of forcing production server * * @internal * Called after loading settings to ensure correct API endpoint @@ -610,12 +611,10 @@ export default class HomeView extends Vue { private async ensureCorrectApiServer() { const { DEFAULT_ENDORSER_API_SERVER } = await import("../constants/app"); - if (process.env.VITE_PLATFORM === "electron") { - // **CRITICAL FIX**: Always use production API server for Electron - // This prevents the capacitor-electron:// protocol from being used for API calls - this.apiServer = DEFAULT_ENDORSER_API_SERVER; - } else if (!this.apiServer) { - // **FIX**: Set default API server for web/development if not already set + // FIXED: Remove forced override - respect user preferences + // Only set default if no user preference exists + if (!this.apiServer) { + // Set default API server for any platform if not already set this.apiServer = DEFAULT_ENDORSER_API_SERVER; } } @@ -1177,9 +1176,13 @@ export default class HomeView extends Vue { location: fulfillsPlan ? { lat: fulfillsPlan.locLat, lon: fulfillsPlan.locLon } : null, - inSearchBox: fulfillsPlan - ? this.latLongInAnySearchBox(fulfillsPlan.locLat, fulfillsPlan.locLon) - : null, + inSearchBox: + fulfillsPlan?.locLat && fulfillsPlan?.locLon + ? this.latLongInAnySearchBox( + fulfillsPlan.locLat, + fulfillsPlan.locLon, + ) + : null, finalResult: anyMatch, }); }