diff --git a/Docs/Development_deployment.md b/Docs/Development_deployment.md index 8beafc0a09..a415f99d84 100644 --- a/Docs/Development_deployment.md +++ b/Docs/Development_deployment.md @@ -80,10 +80,22 @@ To use the WSL in Visual Studio Code: or `userlayout=true#` as [Query parameter](URL_Parameters.md). Note that the shorter URLs ( e.g. `bookcases.html`, `aed.html`, ...) _don't_ exist on the development version. + +Developing a local theme +------------------------ + +To test theme changes you locally make, the easiest way is: + +- `npm run strt` which will run the server +- After making changes to some layers and/or themes, run `npm run generate:layeroverview`. This will recompile the relevant themes. +- You might need to refresh (F5) your browser window + +Note that `npm run start` is equivalent to `npm run generate:layeroverview && npm run strt` + Automatic deployment -------------------- -Currently, the master branch is automatically deployed to https://mapcomplete.org/ by a GitHub action. +Currently, the master branch is automatically deployed to https://mapcomplete.org/ by a Forgejo action. Every branch is automatically built (upon push) to `https://pietervdvn.github.io/mc/` by a GitHub action. diff --git a/app/land.ts b/app/land.ts index 65ccc5d58b..57120b5076 100644 --- a/app/land.ts +++ b/app/land.ts @@ -33,6 +33,9 @@ connection.finishLogin(async () => { }) debug.set(dbg) + if(attempt > 10){ + window.location.reload() + } } while (!token) console.log("Login finished, redirecting to passthrough; token is " + token) tokenSrc.set(token) diff --git a/src/Logic/Osm/OsmConnection.ts b/src/Logic/Osm/OsmConnection.ts index c83d7f2b73..72180d5275 100644 --- a/src/Logic/Osm/OsmConnection.ts +++ b/src/Logic/Osm/OsmConnection.ts @@ -583,9 +583,14 @@ export class OsmConnection { } private async loginAndroidPolyfill() { + const key = "https://www.openstreetmap.orgoauth2_access_token" + if(localStorage.getItem(key)){ + // We are probably already logged in + return + } const token = await AndroidPolyfill.requestLoginCodes() console.log("Got login token!", token) - localStorage.setItem("https://www.openstreetmap.orgoauth2_access_token", token) + localStorage.setItem(key, token) if (this.auth.authenticated()) { console.log("Logged in!") } diff --git a/src/Logic/State/FeatureSwitchState.ts b/src/Logic/State/FeatureSwitchState.ts index d364d7df4a..1fbbaf9e77 100644 --- a/src/Logic/State/FeatureSwitchState.ts +++ b/src/Logic/State/FeatureSwitchState.ts @@ -182,7 +182,7 @@ export default class FeatureSwitchState extends OsmConnectionFeatureSwitches { let testingDefaultValue = false if ( - !Constants.osmAuthConfig.url.startsWith("https://master.apis.dev.openstreetmap.org") && (location.hostname === "127.0.0.1") && !Utils.runningFromConsole + !Constants.osmAuthConfig.url.startsWith("https://master.apis.dev.openstreetmap.org") && !Utils.runningFromConsole && location.hostname === "127.0.0.1" ) { testingDefaultValue = true }