mirror of
https://github.com/hyperspacedev/hyperspace
synced 2025-02-06 04:13:22 +01:00
Filter out "desktop" and "dynamic" in location (#193, HD-63 #in-review)
This commit is contained in:
parent
9238f8851a
commit
564a9d26f9
@ -133,16 +133,20 @@ export function createUserDefaults() {
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the configuration data from `config.json`
|
||||
* Gets the configuration data from `config.json`.
|
||||
*
|
||||
* In scenarios where the app is being run from the desktop or from a local React server
|
||||
* started by react-scripts, the location field is adjusted accordingly.
|
||||
*
|
||||
* @returns The Promise data from getting the config.
|
||||
*/
|
||||
export async function getConfig(): Promise<Config | undefined> {
|
||||
try {
|
||||
const resp = await axios.get("config.json");
|
||||
|
||||
let { location } = resp.data;
|
||||
let { location }: { location: string } = resp.data;
|
||||
|
||||
if (!location.endsWith("/")) {
|
||||
if (!location.endsWith("/") && (location !== "desktop" && location !== "dynamic")) {
|
||||
console.info(
|
||||
"Location does not have a backslash, so Hyperspace has added it automatically."
|
||||
);
|
||||
|
Loading…
x
Reference in New Issue
Block a user