Add setting for hiding quick search buttons
All checks were successful
CI / Lint (pull_request) Successful in 28s
CI / Test (pull_request) Successful in 44s
Release Drafter / Update release notes draft (pull_request) Successful in 4s

This commit is contained in:
2026-03-27 13:59:36 +04:00
parent d72e5f3de2
commit 5978f67d48
4 changed files with 56 additions and 3 deletions

View File

@@ -5,6 +5,7 @@ export default class SettingsService extends Service {
@tracked overpassApi = 'https://overpass-api.de/api/interpreter';
@tracked mapKinetic = true;
@tracked photonApi = 'https://photon.komoot.io/api/';
@tracked showQuickSearchButtons = true;
overpassApis = [
{
@@ -56,6 +57,13 @@ export default class SettingsService extends Service {
this.mapKinetic = savedKinetic === 'true';
}
// Default is true (initialized in class field)
const savedShowQuickSearch = localStorage.getItem(
'marco:show-quick-search'
);
if (savedShowQuickSearch !== null) {
this.showQuickSearchButtons = savedShowQuickSearch === 'true';
}
}
updateOverpassApi(url) {
@@ -68,6 +76,11 @@ export default class SettingsService extends Service {
localStorage.setItem('marco:map-kinetic', String(enabled));
}
updateShowQuickSearchButtons(enabled) {
this.showQuickSearchButtons = enabled;
localStorage.setItem('marco:show-quick-search', String(enabled));
}
updatePhotonApi(url) {
this.photonApi = url;
}