From ef01d028ba2a82c5314e710d14d8433bc8bf16e8 Mon Sep 17 00:00:00 2001 From: Eugene Burmakin Date: Sat, 13 Sep 2025 12:07:29 +0200 Subject: [PATCH] Load leaflet protomaps only if not selfhosted on public month page --- app/javascript/controllers/sharing_modal_controller.js | 8 ++++---- app/views/stats/public_month.html.erb | 8 +++++--- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/app/javascript/controllers/sharing_modal_controller.js b/app/javascript/controllers/sharing_modal_controller.js index aabf3280..eb6e9ade 100644 --- a/app/javascript/controllers/sharing_modal_controller.js +++ b/app/javascript/controllers/sharing_modal_controller.js @@ -34,7 +34,7 @@ export default class extends Controller { const formData = new FormData() formData.append('enabled', this.enableToggleTarget.checked ? '1' : '0') - + if (this.enableToggleTarget.checked && this.hasExpirationSelectTarget) { formData.append('expiration', this.expirationSelectTarget.value || '1h') } else if (this.enableToggleTarget.checked) { @@ -55,13 +55,13 @@ export default class extends Controller { .then(response => response.json()) .then(data => { this.hideLoadingState() - + if (data.success) { // Update sharing link if provided if (data.sharing_url) { this.sharingLinkTarget.value = data.sharing_url } - + // Show a subtle notification for auto-save this.showNotification("✓ Auto-saved", "success") } else { @@ -128,4 +128,4 @@ export default class extends Controller { toast.remove() }, 3000) } -} \ No newline at end of file +} diff --git a/app/views/stats/public_month.html.erb b/app/views/stats/public_month.html.erb index 2044e337..dec15c15 100644 --- a/app/views/stats/public_month.html.erb +++ b/app/views/stats/public_month.html.erb @@ -19,9 +19,11 @@ - - - + + <% if @self_hosted %> + + + <% end %>