Browse Source

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
profile_include_location
Matthew Raymer 2 weeks ago
parent
commit
7f7680f4a6
  1. 23
      src/views/HomeView.vue

23
src/views/HomeView.vue

@ -601,8 +601,9 @@ export default class HomeView extends Vue {
} }
/** /**
* Ensures API server is correctly set for the current platform * Ensures correct API server configuration
* For Electron, always use production endpoint regardless of saved settings *
* FIXED: Now respects user preferences instead of forcing production server
* *
* @internal * @internal
* Called after loading settings to ensure correct API endpoint * Called after loading settings to ensure correct API endpoint
@ -610,12 +611,10 @@ export default class HomeView extends Vue {
private async ensureCorrectApiServer() { private async ensureCorrectApiServer() {
const { DEFAULT_ENDORSER_API_SERVER } = await import("../constants/app"); const { DEFAULT_ENDORSER_API_SERVER } = await import("../constants/app");
if (process.env.VITE_PLATFORM === "electron") { // FIXED: Remove forced override - respect user preferences
// **CRITICAL FIX**: Always use production API server for Electron // Only set default if no user preference exists
// This prevents the capacitor-electron:// protocol from being used for API calls if (!this.apiServer) {
this.apiServer = DEFAULT_ENDORSER_API_SERVER; // Set default API server for any platform if not already set
} else if (!this.apiServer) {
// **FIX**: Set default API server for web/development if not already set
this.apiServer = DEFAULT_ENDORSER_API_SERVER; this.apiServer = DEFAULT_ENDORSER_API_SERVER;
} }
} }
@ -1177,8 +1176,12 @@ export default class HomeView extends Vue {
location: fulfillsPlan location: fulfillsPlan
? { lat: fulfillsPlan.locLat, lon: fulfillsPlan.locLon } ? { lat: fulfillsPlan.locLat, lon: fulfillsPlan.locLon }
: null, : null,
inSearchBox: fulfillsPlan inSearchBox:
? this.latLongInAnySearchBox(fulfillsPlan.locLat, fulfillsPlan.locLon) fulfillsPlan?.locLat && fulfillsPlan?.locLon
? this.latLongInAnySearchBox(
fulfillsPlan.locLat,
fulfillsPlan.locLon,
)
: null, : null,
finalResult: anyMatch, finalResult: anyMatch,
}); });

Loading…
Cancel
Save