MapComplete/src/land.ts
Pieter Vander Vennet badfbb60e4 Chore: formatting
2023-09-21 15:29:34 +02:00

12 lines
431 B
TypeScript

import { OsmConnection } from "./Logic/Osm/OsmConnection"
console.log("Authorizing...")
new OsmConnection().finishLogin((previousURL) => {
const fallback = window.location.protocol + "//" + window.location.host + "/index.html"
previousURL ??= fallback
if (previousURL.indexOf("/land") > 0) {
previousURL = fallback
}
console.log("Redirecting to", previousURL)
window.location.href = previousURL
})