mapcomplete/src/land.ts

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

13 lines
431 B
TypeScript
Raw Normal View History

2023-09-21 15:29:34 +02:00
import { OsmConnection } from "./Logic/Osm/OsmConnection"
2023-09-01 21:36:39 +02:00
2023-09-21 15:29:34 +02:00
console.log("Authorizing...")
new OsmConnection().finishLogin((previousURL) => {
const fallback = window.location.protocol + "//" + window.location.host + "/index.html"
2023-09-01 21:36:39 +02:00
previousURL ??= fallback
2023-09-21 15:29:34 +02:00
if (previousURL.indexOf("/land") > 0) {
2023-09-01 21:36:39 +02:00
previousURL = fallback
}
console.log("Redirecting to", previousURL)
window.location.href = previousURL
})