From e127511262aa4f6ba7f0064ff12190dae4e4439a Mon Sep 17 00:00:00 2001 From: Eugene Burmakin Date: Sat, 26 Jul 2025 13:06:06 +0200 Subject: [PATCH 1/2] Fix live map checkbox --- CHANGELOG.md | 1 + app/javascript/controllers/maps_controller.js | 6 ++++++ app/models/point.rb | 2 ++ 3 files changed, 9 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 309ec73c..6f9d8e87 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,6 +14,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/). ## Fixed - The Warden error in jobs is now fixed. #1556 +- The Live Map setting is now respected. diff --git a/app/javascript/controllers/maps_controller.js b/app/javascript/controllers/maps_controller.js index 12092891..1efff1e7 100644 --- a/app/javascript/controllers/maps_controller.js +++ b/app/javascript/controllers/maps_controller.js @@ -969,6 +969,12 @@ export default class extends BaseController { this.routeOpacity = parseFloat(newSettings.route_opacity) || 0.6; this.clearFogRadius = parseInt(newSettings.fog_of_war_meters) || 50; + // Update the DOM data attribute to keep it in sync + const mapElement = document.getElementById('map'); + if (mapElement) { + mapElement.setAttribute('data-user_settings', JSON.stringify(this.userSettings)); + } + // Store current layer states const layerStates = { Points: this.map.hasLayer(this.markersLayer), diff --git a/app/models/point.rb b/app/models/point.rb index 7be8524a..838e59ff 100644 --- a/app/models/point.rb +++ b/app/models/point.rb @@ -70,6 +70,8 @@ class Point < ApplicationRecord # rubocop:disable Metrics/MethodLength Metrics/AbcSize def broadcast_coordinates + return unless user.safe_settings.live_map_enabled + PointsChannel.broadcast_to( user, [ From cb9525cb776f81f72b1c1d033e305ce7716db24f Mon Sep 17 00:00:00 2001 From: Eugene Burmakin Date: Sat, 26 Jul 2025 13:10:24 +0200 Subject: [PATCH 2/2] Add missing live map info modal. --- CHANGELOG.md | 1 + app/views/map/_settings_modals.html.erb | 17 +++++++++++++++++ 2 files changed, 18 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6f9d8e87..549c693d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,6 +15,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/). - The Warden error in jobs is now fixed. #1556 - The Live Map setting is now respected. +- The Live Map info modal is now displayed. #665 diff --git a/app/views/map/_settings_modals.html.erb b/app/views/map/_settings_modals.html.erb index 24d965a5..31bb3d12 100644 --- a/app/views/map/_settings_modals.html.erb +++ b/app/views/map/_settings_modals.html.erb @@ -156,6 +156,23 @@ + + +