From b1b708dd457c77b5fc6cd8943605fb6ca639f593 Mon Sep 17 00:00:00 2001 From: dwrz Date: Sun, 5 Jul 2026 01:56:14 +0000 Subject: [PATCH] Add geolocation options --- internal/service/static/main.js | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/internal/service/static/main.js b/internal/service/static/main.js index 0f2628e..ae0a605 100644 --- a/internal/service/static/main.js +++ b/internal/service/static/main.js @@ -24,6 +24,14 @@ const StreamEventMessage = 'message'; const ContentTypeImageURL = 'image_url'; const ContentTypeText = 'text'; +// GeolocationOptions: coarse accuracy is sufficient for chat context. +// 30s cache avoids redundant GPS requests on repeated taps. +const GeolocationOptions = { + enableHighAccuracy: false, + timeout: 20_000, + maximumAge: 30_000, +}; + class Odidere { constructor({ document }) { this.document = document; @@ -1050,7 +1058,8 @@ class Odidere { this.$location.classList.add('compose__action-btn--location', 'active'); this.updateSendButtonState(); }, - () => {}, + () => { }, + GeolocationOptions, ); }