check if main page

This commit is contained in:
Zhora Shalyapin 2025-02-26 09:22:17 +00:00
parent 918df9d2df
commit 9d09389203

10
main.js
View File

@ -103,6 +103,11 @@
document.head.appendChild(css)
}
function isMainPage() {
let params = new URLSearchParams(document.location.search)
return params.get("action") !== "edit"
}
async function sendData(formData) {
return await fetch(`https://runcity.geo.rictum.ru/api/competitions/${window.location.pathname.split('/')[1]}/update`, {
method: 'POST',
@ -1021,6 +1026,11 @@
addCss('https://api.mapbox.com/mapbox.js/plugins/leaflet-fullscreen/v1.0.1/leaflet.fullscreen.css')
addCss("https://cdn.jsdelivr.net/npm/swiper@11/swiper-bundle.min.css")
if (isMainPage()) {
return
}
/* NEW DEFALUT VALUES */
document.querySelector(`#props input[name="new_file_type1"][value="l"]`).click()