forked from trent_larson/crowd-funder-for-time-pwa
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
This commit is contained in:
@@ -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,
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user