Skip to content
This repository has been archived by the owner on Jun 17, 2022. It is now read-only.

Commit

Permalink
Update getConfig to change location field if running in dev mode
Browse files Browse the repository at this point in the history
  • Loading branch information
alicerunsonfedora committed Feb 25, 2020
1 parent 1e54b21 commit afd3a7f
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/utilities/settings.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -140,11 +140,17 @@ export async function getConfig(): Promise<Config | undefined> {
let { location } = resp.data;

if (!location.endsWith("/")) {
console.warn(
console.info(
"Location does not have a backslash, so Hyperspace has added it automatically."
);
resp.data.location = location + "/";
}

if (process.env.NODE_ENV === "development") {
resp.data.location = "http://localhost:3000/";
console.info("Location field has been updated to localhost:3000.");
}

return resp.data as Config;
} catch (err) {
console.error(
Expand Down

0 comments on commit afd3a7f

Please sign in to comment.