]> git.openstreetmap.org Git - nominatim-ui.git/blobdiff - src/components/LastUpdated.svelte
npm package updates
[nominatim-ui.git] / src / components / LastUpdated.svelte
index a5b3277e2408b86cbd797cecd30c131a3ae9355f..08be5d9aa54b3b51692c5166958ba65a4441c350 100644 (file)
@@ -9,11 +9,18 @@
   let fetch_running = false; // prevent multiple parallel fetch runs
 
   last_api_request_url_store.subscribe(url => {
   let fetch_running = false; // prevent multiple parallel fetch runs
 
   last_api_request_url_store.subscribe(url => {
+    last_api_request_url = url;
+
+    if (last_api_request_url) {
+      last_api_request_url = new URL(last_api_request_url, window.location.origin);
+      last_api_request_url.searchParams.delete('polygon_geojson');
+      last_api_request_url = last_api_request_url.toString();
+    }
+
     if (fetch_running || last_updated_date) return;
 
     fetch_running = true;
 
     if (fetch_running || last_updated_date) return;
 
     fetch_running = true;
 
-    last_api_request_url = url;
     fetch_from_api('status', { format: 'json' }, function (data) {
       last_updated_date = data.data_updated;
       fetch_running = false;
     fetch_from_api('status', { format: 'json' }, function (data) {
       last_updated_date = data.data_updated;
       fetch_running = false;
@@ -41,7 +48,7 @@
 
 <div id="last-updated" class="container-fluid py-2 px-4 mb-3">
   <div id="loading" class="py-2 px-4">
 
 <div id="last-updated" class="container-fluid py-2 px-4 mb-3">
   <div id="loading" class="py-2 px-4">
-    <div class="spinner-border spinner-border-sm text-primary mr-1" role="status"></div>
+    <div class="spinner-border spinner-border-sm text-primary me-1" role="status"></div>
     Loading data from API ...
   </div>
   <div class="row">
     Loading data from API ...
   </div>
   <div class="row">
@@ -55,7 +62,7 @@
         </div>
       {/if}
     </div>
         </div>
       {/if}
     </div>
-    <div class="col-sm-6 text-right">
+    <div class="col-sm-6 text-end">
       {#if last_updated_date}
         Data last updated:
         <abbr id="data-date" title="{last_updated_date} (UTC timezone)">{timeago.format(new Date(last_updated_date))}</abbr>
       {#if last_updated_date}
         Data last updated:
         <abbr id="data-date" title="{last_updated_date} (UTC timezone)">{timeago.format(new Date(last_updated_date))}</abbr>