X-Git-Url: https://git.openstreetmap.org./nominatim-ui.git/blobdiff_plain/c17ad0ef44aa8e1c091d8d1ab729a5ce6c61e222..0aa28e47e87fc78e152de7f1750e97ccf260c595:/src/lib/stores.js?ds=sidebyside diff --git a/src/lib/stores.js b/src/lib/stores.js index 03f32cc..35344ce 100644 --- a/src/lib/stores.js +++ b/src/lib/stores.js @@ -16,16 +16,27 @@ export const page = writable(); * the requested query parameters. It may also be omitted completely for a * link without query parameters. */ -const pagenames = ['search', 'reverse', 'details', 'deletable', 'polygons', 'status', 'about']; +const default_pagename = Nominatim_Config.Reverse_Only ? 'reverse' : 'search'; +const pagenames = [ + default_pagename, + 'reverse', + 'details', + 'deletable', + 'polygons', + 'status', + 'about' +]; export function refresh_page(pagename, params) { if (typeof pagename === 'undefined') { pagename = window.location.pathname.replace('.html', '').replace(/^.*\//, ''); - if (!pagenames.includes(pagename)) pagename = 'search'; + if (!pagenames.includes(pagename)) pagename = default_pagename; params = new URLSearchParams(window.location.search); } else { + if (!pagenames.includes(pagename)) pagename = default_pagename; + if (typeof params === 'undefined') { params = new URLSearchParams(); }